1
0
Fork 0

Make sure cd call allows switching drives on windows, fixes #1971

pull/1979/merge
Jordi Boggiano 2013-06-08 16:41:34 +02:00
parent 8b8dc1fd70
commit 4cac2caf70
2 changed files with 4 additions and 1 deletions

View File

@ -30,7 +30,8 @@ class GitDownloader extends VcsDownloader
$this->cleanEnv(); $this->cleanEnv();
$ref = $package->getSourceReference(); $ref = $package->getSourceReference();
$command = 'git clone %s %s && cd %2$s && git remote add composer %1$s && git fetch composer'; $flag = defined('PHP_WINDOWS_VERSION_MAJOR') ? '/D ' : '';
$command = 'git clone %s %s && cd '.$flag.'%2$s && git remote add composer %1$s && git fetch composer';
$this->io->write(" Cloning ".$ref); $this->io->write(" Cloning ".$ref);
$commandCallable = function($url) use ($ref, $path, $command) { $commandCallable = function($url) use ($ref, $path, $command) {

View File

@ -300,6 +300,8 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
private function getCmd($cmd) private function getCmd($cmd)
{ {
if (defined('PHP_WINDOWS_VERSION_BUILD')) { if (defined('PHP_WINDOWS_VERSION_BUILD')) {
$cmd = str_replace('cd ', 'cd /D ', $cmd);
return strtr($cmd, "'", '"'); return strtr($cmd, "'", '"');
} }