diff --git a/system/src/Grav/Console/Cli/InstallCommand.php b/system/src/Grav/Console/Cli/InstallCommand.php
index 24d199b2a..afcd80c02 100644
--- a/system/src/Grav/Console/Cli/InstallCommand.php
+++ b/system/src/Grav/Console/Cli/InstallCommand.php
@@ -156,23 +156,32 @@ class InstallCommand extends ConsoleCommand
exec('cd ' . $this->destination);
foreach ($this->config['links'] as $repo => $data) {
- $from = $this->local_config[$data['scm'] . '_repos'] . $data['src'];
+ $repos = (array) $this->local_config[$data['scm'] . '_repos'];
+ $from = false;
$to = $this->destination . $data['path'];
- if (file_exists($from)) {
- if (!file_exists($to)) {
- symlink($from, $to);
- $this->output->writeln('SUCCESS symlinked ' . $data['src'] . ' -> ' . $data['path'] . '');
- $this->output->writeln('');
- } else {
- $this->output->writeln('destination: ' . $to . ' already exists, skipping...');
- $this->output->writeln('');
+ foreach ($repos as $repo) {
+ $path = $repo . $data['src'];
+ if (file_exists($path)) {
+ $from = $path;
+ continue;
}
- } else {
+ }
+
+ if (!$from) {
$this->output->writeln('source: ' . $from . ' does not exists, skipping...');
$this->output->writeln('');
}
+ if (!file_exists($to)) {
+ symlink($from, $to);
+ $this->output->writeln('SUCCESS symlinked ' . $data['src'] . ' -> ' . $data['path'] . '');
+ $this->output->writeln('');
+ } else {
+ $this->output->writeln('destination: ' . $to . ' already exists, skipping...');
+ $this->output->writeln('');
+ }
+
}
}
}
diff --git a/system/src/Grav/Console/Gpm/InstallCommand.php b/system/src/Grav/Console/Gpm/InstallCommand.php
index d7e932e4e..031142825 100644
--- a/system/src/Grav/Console/Gpm/InstallCommand.php
+++ b/system/src/Grav/Console/Gpm/InstallCommand.php
@@ -444,18 +444,21 @@ class InstallCommand extends ConsoleCommand
{
$matches = $this->getGitRegexMatches($package);
- foreach ($this->local_config as $path) {
+ foreach ($this->local_config as $paths) {
if (Utils::endsWith($matches[2], '.git')) {
$repo_dir = preg_replace('/\.git$/', '', $matches[2]);
} else {
$repo_dir = $matches[2];
}
-
- $from = rtrim($path, '/') . '/' . $repo_dir;
-
- if (file_exists($from)) {
- return $from;
+
+ $paths = (array) $paths;
+ foreach ($paths as $repo) {
+ $path = rtrim($repo, '/') . '/' . $repo_dir;
+ if (file_exists($path)) {
+ return $path;
+ }
}
+
}
return false;