1
0
Fork 0

Fix undefined var, fixes #1235

pull/1241/merge
Jordi Boggiano 2012-10-21 16:03:05 +02:00
parent 7d97d54de0
commit 3116c979d3
1 changed files with 4 additions and 3 deletions

View File

@ -36,13 +36,14 @@ class HgDriver extends VcsDriver
if (static::isLocalUrl($this->url)) {
$this->repoDir = str_replace('file://', '', $this->url);
} else {
$this->repoDir = $this->config->get('home') . '/cache.hg/' . preg_replace('{[^a-z0-9]}i', '-', $this->url) . '/';
$cacheDir = $this->config->get('home') . '/cache.hg';
$this->repoDir = $cacheDir . '/' . preg_replace('{[^a-z0-9]}i', '-', $this->url) . '/';
$fs = new Filesystem();
$fs->ensureDirectoryExists(dirname($this->repoDir));
$fs->ensureDirectoryExists($cacheDir);
if (!is_writable(dirname($this->repoDir))) {
throw new \RuntimeException('Can not clone '.$this->url.' to access package information. The "'.dirname($this->repoDir).'" directory is not writable by the current user.');
throw new \RuntimeException('Can not clone '.$this->url.' to access package information. The "'.$cacheDir.'" directory is not writable by the current user.');
}
// update the repo if it is a valid hg repository