Skip to content

Commit ff2cf46

Browse files
committedMay 23, 2016
Issue #1 Fix spaces in command name on Windows
1 parent 66a57ca commit ff2cf46

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎src/Command.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,13 @@ public function setOptions($options)
142142
*/
143143
public function setCommand($command)
144144
{
145-
$this->_command = $this->escapeCommand ? escapeshellcmd($command) : $command;
145+
if ($this->escapeCommand) {
146+
$command = escapeshellcmd($command);
147+
}
148+
if ($this->getIsWindows()) {
149+
$command = sprintf('cd %s && %s', escapeshellarg(dirname($command)), basename($command));
150+
}
151+
$this->_command = $command;
146152
return $this;
147153
}
148154

0 commit comments

Comments
 (0)
Please sign in to comment.