Few fixes for windows

This commit is contained in:
Dmitry Khomutov 2014-05-09 14:57:22 +07:00
parent d9264378e7
commit 3ea6b720b1
3 changed files with 13 additions and 1 deletions

View file

@ -38,6 +38,9 @@ class CleanBuild implements \PHPCI\Plugin
public function execute() public function execute()
{ {
$cmd = 'rm -Rf "%s"'; $cmd = 'rm -Rf "%s"';
if (IS_WIN) {
$cmd = 'rmdir /S /Q "%s"';
}
$this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.phar'); $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.phar');
$this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.lock'); $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.lock');

View file

@ -46,11 +46,17 @@ class CopyBuild implements \PHPCI\Plugin
} }
$cmd = 'mkdir -p "%s" && cp -R "%s" "%s"'; $cmd = 'mkdir -p "%s" && cp -R "%s" "%s"';
if (IS_WIN) {
$cmd = 'mkdir -p "%s" && xcopy /E "%s" "%s"';
}
$success = $this->phpci->executeCommand($cmd, $this->directory, $build, $this->directory); $success = $this->phpci->executeCommand($cmd, $this->directory, $build, $this->directory);
if ($this->ignore) { if ($this->ignore) {
foreach ($this->phpci->ignore as $file) { foreach ($this->phpci->ignore as $file) {
$cmd = 'rm -Rf "%s/%s"'; $cmd = 'rm -Rf "%s/%s"';
if (IS_WIN) {
$cmd = 'rmdir /S /Q "%s\%s"';
}
$this->phpci->executeCommand($cmd, $this->directory, $file); $this->phpci->executeCommand($cmd, $this->directory, $file);
} }
} }

View file

@ -52,7 +52,10 @@ class Wipe implements \PHPCI\Plugin
return true; return true;
} }
if (is_dir($this->directory)) { if (is_dir($this->directory)) {
$cmd = 'rm -rf %s*'; $cmd = 'rm -Rf "%s"';
if (IS_WIN) {
$cmd = 'rmdir /S /Q "%s"';
}
$success = $this->phpci->executeCommand($cmd, $this->directory); $success = $this->phpci->executeCommand($cmd, $this->directory);
} }
return $success; return $success;