Merge pull request #9695 from Seldaek/avoid-invalid-dir
Fix processes silently ignoring the CWD when it does not existpull/9702/head
commit
812207c823
|
@ -38,6 +38,9 @@ class GitDriver extends VcsDriver
|
||||||
{
|
{
|
||||||
if (Filesystem::isLocalPath($this->url)) {
|
if (Filesystem::isLocalPath($this->url)) {
|
||||||
$this->url = preg_replace('{[\\/]\.git/?$}', '', $this->url);
|
$this->url = preg_replace('{[\\/]\.git/?$}', '', $this->url);
|
||||||
|
if (!is_dir($this->url)) {
|
||||||
|
throw new \RuntimeException('Failed to read package information from '.$this->url.' as the path does not exist');
|
||||||
|
}
|
||||||
$this->repoDir = $this->url;
|
$this->repoDir = $this->url;
|
||||||
$cacheUrl = realpath($this->url);
|
$cacheUrl = realpath($this->url);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -61,6 +61,10 @@ class ProcessExecutor
|
||||||
$cwd = realpath(getcwd());
|
$cwd = realpath(getcwd());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (null !== $cwd && !is_dir($cwd)) {
|
||||||
|
throw new \RuntimeException('The given CWD for the process does not exist: '.$cwd);
|
||||||
|
}
|
||||||
|
|
||||||
$this->captureOutput = func_num_args() > 1;
|
$this->captureOutput = func_num_args() > 1;
|
||||||
$this->errorOutput = null;
|
$this->errorOutput = null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue