test shell2

This commit is contained in:
aliaxander 2016-02-22 01:06:26 +03:00
parent 299ec5ce7d
commit 2a5a25e5f9
2 changed files with 7 additions and 5 deletions

View file

@ -15,6 +15,7 @@ use PHPCI\Model\Build;
/** /**
* Shell Plugin - Allows execute shell commands. * Shell Plugin - Allows execute shell commands.
*
* @author Kinn Coelho Julião <kinncj@gmail.com> * @author Kinn Coelho Julião <kinncj@gmail.com>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
@ -59,6 +60,7 @@ class Shell implements \PHPCI\Plugin
// Keeping this for backwards compatibility, new projects should use interpolation vars. // Keeping this for backwards compatibility, new projects should use interpolation vars.
$options['command'] = str_replace("%buildpath%", $this->phpci->buildPath, $options['command']); $options['command'] = str_replace("%buildpath%", $this->phpci->buildPath, $options['command']);
$this->commands = array($options['command']); $this->commands = array($options['command']);
return; return;
} }
@ -87,7 +89,7 @@ class Shell implements \PHPCI\Plugin
foreach ($this->commands as $command) { foreach ($this->commands as $command) {
$command = $this->phpci->interpolate($command); $command = $this->phpci->interpolate($command);
print_r($command);
if (!$this->phpci->executeCommand($command)) { if (!$this->phpci->executeCommand($command)) {
$success = false; $success = false;
} }

View file

@ -37,7 +37,7 @@ class Shell2 implements \PHPCI\Plugin
/** /**
* @var string[] $commands The commands to be executed * @var string[] $commands The commands to be executed
*/ */
protected $commands = array(); protected $command;
/** /**
* Standard Constructor * Standard Constructor
@ -58,8 +58,8 @@ class Shell2 implements \PHPCI\Plugin
if (isset($options['command'])) { if (isset($options['command'])) {
// Keeping this for backwards compatibility, new projects should use interpolation vars. // Keeping this for backwards compatibility, new projects should use interpolation vars.
$options['command'] = str_replace("%buildpath%", $options['directory'], $options['command']); $options['command'] = str_replace("%buildpath%", $this->phpci->buildPath, $options['command']);
$this->commands = $options['command']; $this->command = $options['command'];
return; return;
} }
@ -76,7 +76,7 @@ class Shell2 implements \PHPCI\Plugin
$success = true; $success = true;
if (!$this->phpci->executeCommand($this->commands)) { if (!$this->phpci->executeCommand($this->command)) {
$success = false; $success = false;
} }