Escape " from remote commands.

This commit is contained in:
Andrés Montañez 2012-10-24 19:52:29 -02:00
parent ad6f3cb6ee
commit 14b36eab88
4 changed files with 4 additions and 4 deletions

View file

@ -22,7 +22,7 @@ class Mage_Task_BuiltIn_Deployment_Release
// Fetch the user and group from base directory
$userGroup = '33:33';
$resultFetch = $this->_runRemoteCommand('ls -ld . | awk \'{print \$3\":\"\$4}\'', $userGroup);
$resultFetch = $this->_runRemoteCommand('ls -ld . | awk \'{print \$3":"\$4}\'', $userGroup);
// Remove symlink if exists; create new symlink and change owners
$command = 'rm -f ' . $symlink

View file

@ -22,7 +22,7 @@ class Mage_Task_BuiltIn_Deployment_Rsync
if ($overrideRelease == true) {
$releaseToOverride = false;
$resultFetch = $this->_runRemoteCommand('ls -ld current | cut -d\"/\" -f2', $releaseToOverride);
$resultFetch = $this->_runRemoteCommand('ls -ld current | cut -d"/" -f2', $releaseToOverride);
if (is_numeric($releaseToOverride)) {
$this->getConfig()->setReleaseId($releaseToOverride);
}

View file

@ -98,7 +98,7 @@ class Mage_Task_BuiltIn_Releases_Rollback
Mage_Console::output('Running <purple>Rollback Release [id=' . $releaseId . ']</purple> ... ', 2, false);
$userGroup = '';
$resultFetch = $this->_runRemoteCommand('ls -ld ' . $rollbackTo . ' | awk \'{print \$3\":\"\$4}\'', $userGroup);
$resultFetch = $this->_runRemoteCommand('ls -ld ' . $rollbackTo . ' | awk \'{print \$3":"\$4}\'', $userGroup);
$command = 'rm -f ' . $symlink
. ' && '
. 'ln -sf ' . $rollbackTo . ' ' . $symlink

View file

@ -74,7 +74,7 @@ abstract class Mage_Task_TaskAbstract
. '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '
. $this->_config->deployment('user') . '@' . $this->_config->getHostName() . ' '
. '"cd ' . rtrim($this->_config->deployment('to'), '/') . $releasesDirectory . ' && '
. $command . '"';
. str_replace('"', '\"', $command) . '"';
return $this->_runLocalCommand($localCommand, $output);
}