Skip to content

Commit

Permalink
Merge pull request #55 from hAbd0u/fix-setCommand
Browse files Browse the repository at this point in the history
Fix getExecCommand() to get the latest command set instead only the first…
  • Loading branch information
mikehaertl authored Mar 17, 2021
2 parents fe86ec8 + 718d187 commit 3488d78
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ class Command
*/
protected $_args = array();

/**
* @var string the full command string to execute
*/
protected $_execCommand;

/**
* @var string the stdout output
*/
Expand Down Expand Up @@ -232,16 +227,14 @@ public function getCommand()
*/
public function getExecCommand()
{
if ($this->_execCommand===null) {
$command = $this->getCommand();
if (!$command) {
$this->_error = 'Could not locate any executable command';
return false;
}
$args = $this->getArgs();
$this->_execCommand = $args ? $command.' '.$args : $command;
$command = $this->getCommand();
if (!$command) {
$this->_error = 'Could not locate any executable command';
return false;
}
return $this->_execCommand;

$args = $this->getArgs();
return $args ? $command.' '.$args : $command;
}

/**
Expand Down

0 comments on commit 3488d78

Please sign in to comment.