From aab71eceac19697f33fea8abf73f19b8eb0e84cf Mon Sep 17 00:00:00 2001 From: spongeben Date: Mon, 9 Feb 2015 14:44:34 +0100 Subject: [PATCH] Change "current" symlink owner only if it exists --- Mage/Task/BuiltIn/Deployment/ReleaseTask.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Mage/Task/BuiltIn/Deployment/ReleaseTask.php b/Mage/Task/BuiltIn/Deployment/ReleaseTask.php index 4ecf586..095116e 100644 --- a/Mage/Task/BuiltIn/Deployment/ReleaseTask.php +++ b/Mage/Task/BuiltIn/Deployment/ReleaseTask.php @@ -74,12 +74,13 @@ class ReleaseTask extends AbstractTask implements IsReleaseAware, SkipOnOverride } } - if ($resultFetch && $userGroup != '') { - $command = 'chown -h ' . $userGroup . ' ' . $symlink - . ' && ' - . 'chown -R ' . $userGroup . ' ' . $currentCopy + if ($resultFetch && $userGroup != '') { + $command = 'chown -R ' . $userGroup . ' ' . $currentCopy . ' && ' . 'chown ' . $userGroup . ' ' . $releasesDirectory; + if (file_exists($symlink)) { + $command.= ' && ' . 'chown -h ' . $userGroup . ' ' . $symlink; + } $result = $this->runCommandRemote($command); if (!$result) { return $result;