Skip to content

Commit d9a0e8e

Browse files
committed
Issue #16 Change to correct drive on Windows
1 parent ff2cf46 commit d9a0e8e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Command.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ public function setCommand($command)
146146
$command = escapeshellcmd($command);
147147
}
148148
if ($this->getIsWindows()) {
149-
$command = sprintf('cd %s && %s', escapeshellarg(dirname($command)), basename($command));
149+
// Make sure to switch to correct drive like "E:" first if we have a full path in command
150+
$chdrive = (isset($command[1]) && $command[1]===':') ? $command[0].': && ' : '';
151+
$command = sprintf($chdrive.'cd %s && %s', escapeshellarg(dirname($command)), basename($command));
150152
}
151153
$this->_command = $command;
152154
return $this;

0 commit comments

Comments
 (0)