Skip to content

Commit ff5b1d4

Browse files
committed
using now cp command for non-windows systems instead of php's copy() to keep symlinks
1 parent 83aebe4 commit ff5b1d4

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

module/DeployAgent/src/Resource/FileSystem/Directory.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@ protected function sync(Workspace $workspace, \SplFileInfo $file)
157157
$destination = $relativePath . DIRECTORY_SEPARATOR . $file->getFilename();
158158
try {
159159
ErrorHandler::start(E_WARNING);
160-
copy($file->getPathname(), $destination);
160+
161+
if (preg_match('/^win/i', PHP_OS)) {
162+
copy($file->getPathname(), $destination);
163+
} else {
164+
exec('cp --no-dereference ' . $file->getPathname() . ' ' . $destination);
165+
}
166+
161167
ErrorHandler::stop(true);
162168
} catch (\ErrorException $e) {
163169
throw new FileSystemException($e->getMessage(), FileSystemException::COPY_ERROR, $e);

module/DeployAgent/src/Task/Runner/Command.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ public function setCommand($command)
4444
public function run(Event $e)
4545
{
4646
$applicationPath = $e->getParam('applicationPath');
47-
47+
4848
passthru("cd $applicationPath && " . $this->getCommand(), $return);
49+
4950
if ($return) {
5051
throw new Exception('The command exit with code ' . $return, Exception::BAD_EXIT_EXCEPTION);
5152
}

0 commit comments

Comments
 (0)