Skip to content

Commit

Permalink
Issue mikehaertl#1 Fix spaces in command name on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehaertl committed May 23, 2016
1 parent 66a57ca commit ff2cf46
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ public function setOptions($options)
*/
public function setCommand($command)
{
$this->_command = $this->escapeCommand ? escapeshellcmd($command) : $command;
if ($this->escapeCommand) {
$command = escapeshellcmd($command);
}
if ($this->getIsWindows()) {
$command = sprintf('cd %s && %s', escapeshellarg(dirname($command)), basename($command));
}
$this->_command = $command;
return $this;
}

Expand Down

0 comments on commit ff2cf46

Please sign in to comment.