1
0
Fork 0

Fix processes silently ignoring the CWD when it does not exist, refs #9694

pull/9695/head
Jordi Boggiano 2021-02-11 12:43:43 +01:00
parent 4d2ae78703
commit abcf9e993b
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 7 additions and 0 deletions

View File

@ -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 {

View File

@ -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;