Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
Fix runInFolder not correctly working for LocalConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
Anahkiasen committed Mar 10, 2015
1 parent f20999e commit 2dfc99a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
19 changes: 8 additions & 11 deletions src/Rocketeer/Services/Connections/LocalConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ public function task($task, Closure $callback = null)
public function run($commands, Closure $callback = null)
{
$commands = (array) $commands;
foreach ($commands as $command) {
exec($command, $output, $status);
$commands = implode(' && ', $commands);

$this->previousStatus = $status;
if ($callback) {
$output = (array) $output;
foreach ($output as $line) {
$callback($line.PHP_EOL);
}
exec($commands, $output, $status);

$this->previousStatus = $status;
if ($callback) {
$output = (array) $output;
foreach ($output as $line) {
$callback($line.PHP_EOL);
}
}
}
Expand All @@ -95,7 +95,6 @@ public function status()
* @param string $remote
*
* @codeCoverageIgnore
*
* @return int
*/
public function put($local, $remote)
Expand All @@ -111,7 +110,6 @@ public function put($local, $remote)
* @param string $remote
*
* @codeCoverageIgnore
*
* @return string
*/
public function getString($remote)
Expand Down Expand Up @@ -140,7 +138,6 @@ public function display($line)
* @param string $contents
*
* @codeCoverageIgnore
*
* @return int
*/
public function putString($remote, $contents)
Expand Down
1 change: 1 addition & 0 deletions src/Rocketeer/Services/ReleasesManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function getReleases()
rsort($releases);

$this->releases = (array) $releases;
$this->releases = array_map('intval', $this->releases);
}

return $this->releases;
Expand Down
2 changes: 1 addition & 1 deletion src/Rocketeer/Tasks/Rollback.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ protected function getRollbackRelease()
$release = $this->releasesManager->getPreviousRelease();
}

return $release;
return (int) $release;
}
}

0 comments on commit 2dfc99a

Please sign in to comment.