mirror of
https://github.com/getgrav/grav.git
synced 2026-01-24 08:19:59 +01:00
moved .dependencies back to root, and added support for root or user destinations
This commit is contained in:
@@ -30,7 +30,7 @@ class InstallCommand extends Command {
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
|
||||
$dependencies_file = USER_DIR . '/.dependencies';
|
||||
$dependencies_file = '.dependencies';
|
||||
$local_config_file = exec('eval echo ~/.grav/config');
|
||||
|
||||
// Create a red output option
|
||||
@@ -45,23 +45,27 @@ class InstallCommand extends Command {
|
||||
$output->writeln('read local config from <cyan>' . $local_config_file . '</cyan>');
|
||||
}
|
||||
|
||||
// Look for dependencies file in ROOT and USER dir
|
||||
if (file_exists(USER_DIR . $dependencies_file)) {
|
||||
$this->config = Yaml::parse(USER_DIR . $dependencies_file);
|
||||
} elseif (file_exists(ROOT_DIR . $dependencies_file )) {
|
||||
$this->config = Yaml::parse(ROOT_DIR . $dependencies_file);
|
||||
} else {
|
||||
$output->writeln('<red>ERROR</red> Missing .dependencies file in <cyan>user/</cyan> folder');
|
||||
}
|
||||
|
||||
|
||||
if (is_file($dependencies_file)) {
|
||||
$this->config = Yaml::parse($dependencies_file);
|
||||
|
||||
// If yaml config, process
|
||||
if ($this->config) {
|
||||
if (!$input->getOption('symlink')) {
|
||||
$this->gitclone($output);
|
||||
} else {
|
||||
$this->symlink($output);
|
||||
}
|
||||
} else {
|
||||
$output->writeln('<red>ERROR</red> Missing .dependencies file in <cyan>user/</cyan> folder');
|
||||
$output->writeln('<red>ERROR</red> invalid YAML in '. $dependencies_file);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// loops over the array of paths and deletes the files/folders
|
||||
|
||||
Reference in New Issue
Block a user