Fixed shell plugin execution. Issue #30
This commit is contained in:
parent
f4b45e142e
commit
58875d5c8a
|
@ -77,10 +77,12 @@ abstract class BaseCommandExecutor implements CommandExecutorInterface
|
|||
{
|
||||
$this->lastOutput = [];
|
||||
|
||||
$command = call_user_func_array('sprintf', $args);
|
||||
$this->logger->logDebug('Command: ' . $command);
|
||||
$this->logger->logDebug('Args: ' . json_encode($args));
|
||||
|
||||
$command = call_user_func_array('sprintf', $args);
|
||||
|
||||
$this->logger->logDebug('Command: ' . $command);
|
||||
|
||||
if ($this->quiet) {
|
||||
$this->logger->log('Executing: ' . $command);
|
||||
}
|
||||
|
@ -119,11 +121,12 @@ abstract class BaseCommandExecutor implements CommandExecutorInterface
|
|||
}
|
||||
|
||||
$rtn = false;
|
||||
|
||||
if ($status == 0) {
|
||||
$rtn = true;
|
||||
}
|
||||
|
||||
$this->logger->logDebug('Execution status: ' . $status);
|
||||
|
||||
return $rtn;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2014, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Plugin;
|
||||
|
||||
|
@ -16,12 +9,13 @@ use PHPCensor\Plugin;
|
|||
/**
|
||||
* Shell Plugin - Allows execute shell commands.
|
||||
*
|
||||
* @author Kinn Coelho Julião <kinncj@gmail.com>
|
||||
* @package PHPCI
|
||||
* @subpackage Plugins
|
||||
* @author Kinn Coelho Julião <kinncj@gmail.com>
|
||||
*/
|
||||
class Shell extends Plugin
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $args;
|
||||
|
||||
/**
|
||||
|
@ -65,19 +59,19 @@ class Shell extends Plugin
|
|||
|
||||
/**
|
||||
* Runs the shell command.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$success = true;
|
||||
|
||||
foreach ($this->commands as $command) {
|
||||
$command = $this->builder->interpolate($command);
|
||||
|
||||
if (!$this->builder->executeCommand($command)) {
|
||||
$success = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return $success;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue