1
0
Fork 0

Fix tmp dir for HgDriver

pull/617/head
Jérôme Tamarelle 2012-04-25 09:49:05 +03:00 committed by Jerome Tamarelle
parent cc6e1397b2
commit d200481037
1 changed files with 2 additions and 3 deletions

View File

@ -34,11 +34,10 @@ class HgDriver extends VcsDriver
$this->tmpDir = $this->config->get('home') . '/cache.hg/' . preg_replace('{[^a-z0-9]}i', '-', $url) . '/'; $this->tmpDir = $this->config->get('home') . '/cache.hg/' . preg_replace('{[^a-z0-9]}i', '-', $url) . '/';
$url = escapeshellarg($this->url); $url = escapeshellarg($this->url);
$tmpDir = escapeshellarg($this->tmpDir);
if (is_dir($this->tmpDir)) { if (is_dir($this->tmpDir)) {
$this->process->execute(sprintf('cd %s && hg pull -u', $tmpDir), $output); $this->process->execute(sprintf('cd %s && hg pull -u', escapeshellarg($this->tmpDir)), $output);
} else { } else {
$this->process->execute(sprintf('cd %s && hg clone %s %s', escapeshellarg(dirname($this->tmpDir)), $url, $tmpDir), $output); $this->process->execute(sprintf('cd %s && hg clone %s %s', escapeshellarg(dirname($this->tmpDir)), $url, escapeshellarg($this->tmpDir)), $output);
} }
$this->getTags(); $this->getTags();