Merge branch '1.10'
commit
e7f6dd287c
|
@ -37,6 +37,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 {
|
||||||
|
|
|
@ -98,11 +98,15 @@ class ProcessExecutor
|
||||||
$this->io->writeError('Executing command ('.($cwd ?: 'CWD').'): '.$safeCommand);
|
$this->io->writeError('Executing command ('.($cwd ?: 'CWD').'): '.$safeCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO in 2.2, these two checks can be dropped as Symfony 4+ supports them out of the box
|
||||||
// make sure that null translate to the proper directory in case the dir is a symlink
|
// make sure that null translate to the proper directory in case the dir is a symlink
|
||||||
// and we call a git command, because msysgit does not handle symlinks properly
|
// and we call a git command, because msysgit does not handle symlinks properly
|
||||||
if (null === $cwd && Platform::isWindows() && false !== strpos($command, 'git') && getcwd()) {
|
if (null === $cwd && Platform::isWindows() && false !== strpos($command, 'git') && getcwd()) {
|
||||||
$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() > 3;
|
$this->captureOutput = func_num_args() > 3;
|
||||||
$this->errorOutput = null;
|
$this->errorOutput = null;
|
||||||
|
@ -235,11 +239,15 @@ class ProcessExecutor
|
||||||
$this->io->writeError('Executing async command ('.($cwd ?: 'CWD').'): '.$safeCommand);
|
$this->io->writeError('Executing async command ('.($cwd ?: 'CWD').'): '.$safeCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO in 2.2, these two checks can be dropped as Symfony 4+ supports them out of the box
|
||||||
// make sure that null translate to the proper directory in case the dir is a symlink
|
// make sure that null translate to the proper directory in case the dir is a symlink
|
||||||
// and we call a git command, because msysgit does not handle symlinks properly
|
// and we call a git command, because msysgit does not handle symlinks properly
|
||||||
if (null === $cwd && Platform::isWindows() && false !== strpos($command, 'git') && getcwd()) {
|
if (null === $cwd && Platform::isWindows() && false !== strpos($command, 'git') && getcwd()) {
|
||||||
$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);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO in v3, commands should be passed in as arrays of cmd + args
|
// TODO in v3, commands should be passed in as arrays of cmd + args
|
||||||
if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
|
if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
|
||||||
|
|
Loading…
Reference in New Issue