mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Fix runLocally.
This commit is contained in:
parent
c578dd6bc5
commit
56ba9f7dae
@ -299,7 +299,7 @@ function run($command)
|
||||
* Execute commands on local machine.
|
||||
* @param string $command Command to run locally.
|
||||
* @param int $timeout (optional) Override process command timeout in seconds.
|
||||
* @return string Output of command.
|
||||
* @return Result Output of command.
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
function runLocally($command, $timeout = 60)
|
||||
@ -312,7 +312,7 @@ function runLocally($command, $timeout = 60)
|
||||
throw new \RuntimeException($process->getErrorOutput());
|
||||
}
|
||||
|
||||
write($process->getOutput());
|
||||
return new Result($process->getOutput());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -115,4 +115,11 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertInstanceOf('Deployer\Task\Scenario\Scenario', $mainScenario);
|
||||
$this->assertEquals(['main', 'after'], $mainScenario->getTasks());
|
||||
}
|
||||
|
||||
public function testRunLocally() {
|
||||
$output = runLocally('echo "hello"');
|
||||
|
||||
$this->assertInstanceOf('Deployer\Type\Result', $output);
|
||||
$this->assertEquals('hello', (string)$output);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user