Browse Source

Escape " from remote commands.

1.0
Andrés Montañez 12 years ago
parent
commit
14b36eab88
  1. 2
      Mage/Task/BuiltIn/Deployment/Release.php
  2. 2
      Mage/Task/BuiltIn/Deployment/Rsync.php
  3. 2
      Mage/Task/BuiltIn/Releases/Rollback.php
  4. 2
      Mage/Task/TaskAbstract.php

2
Mage/Task/BuiltIn/Deployment/Release.php

@ -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

2
Mage/Task/BuiltIn/Deployment/Rsync.php

@ -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);
}

2
Mage/Task/BuiltIn/Releases/Rollback.php

@ -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

2
Mage/Task/TaskAbstract.php

@ -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);
}

Loading…
Cancel
Save