mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Detect error in exec call and output accordingly. Also fix trailing slash in path. Fix #746
This commit is contained in:
parent
a58766be66
commit
88320607fa
|
|
@ -109,10 +109,18 @@ class InstallCommand extends ConsoleCommand
|
|||
$this->output->writeln('');
|
||||
|
||||
foreach ($this->config['git'] as $repo => $data) {
|
||||
$this->destination = rtrim($this->destination, DS);
|
||||
$path = $this->destination . DS . $data['path'];
|
||||
if (!file_exists($path)) {
|
||||
exec('cd "' . $this->destination . '" && git clone -b ' . $data['branch'] . ' ' . $data['url'] . ' ' . $data['path']);
|
||||
$this->output->writeln('<green>SUCCESS</green> cloned <magenta>' . $data['url'] . '</magenta> -> <cyan>' . $path . '</cyan>');
|
||||
exec('cd "' . $this->destination . '" && git clone -b ' . $data['branch'] . ' ' . $data['url'] . ' ' . $data['path'], $output, $return);
|
||||
|
||||
if (!$return) {
|
||||
$this->output->writeln('<green>SUCCESS</green> cloned <magenta>' . $data['url'] . '</magenta> -> <cyan>' . $path . '</cyan>');
|
||||
} else {
|
||||
$this->output->writeln('<red>ERROR</red> cloning <magenta>' . $data['url']);
|
||||
|
||||
}
|
||||
|
||||
$this->output->writeln('');
|
||||
} else {
|
||||
$this->output->writeln('<red>' . $path . ' already exists, skipping...</red>');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user