Fixed 'cd' command for windows

This commit is contained in:
Dmitry Khomutov 2014-03-13 00:37:57 +07:00
commit d0f6d295a1
6 changed files with 28 additions and 5 deletions

View file

@ -67,7 +67,11 @@ class RemoteGitBuild extends Build
$success = $builder->executeCommand('git clone -b %s %s "%s"', $this->getBranch(), $this->getCloneUrl(), $cloneTo);
if (!empty($commit) && $commit != 'Manual') {
$builder->executeCommand('cd "%s" && git checkout %s', $cloneTo, $this->getCommitId());
$cmd = 'cd "%s" && git checkout %s';
if (IS_WIN) {
$cmd = 'cd /d "%s" && git checkout %s';
}
$builder->executeCommand($cmd, $cloneTo, $this->getCommitId());
}
return $success;
@ -97,7 +101,11 @@ class RemoteGitBuild extends Build
$commit = $this->getCommitId();
if (!empty($commit) && $commit != 'Manual') {
$builder->executeCommand('cd "%s" && git checkout %s', $cloneTo, $this->getCommitId());
$cmd = 'cd "%s" && git checkout %s';
if (IS_WIN) {
$cmd = 'cd /d "%s" && git checkout %s';
}
$builder->executeCommand($cmd, $cloneTo, $this->getCommitId());
}
// Remove the key file: