Vendors get now installed via composer automatically through first run of GPM or Grav cli.

This commit is contained in:
Djamil Legato
2014-09-04 16:29:10 -07:00
parent d2cd2a3772
commit 258f55fe96
2 changed files with 12 additions and 2 deletions

View File

@@ -5,6 +5,13 @@ if (version_compare($ver = PHP_VERSION, $req = '5.4.0', '<')) {
exit(sprintf("You are running PHP %s, but Grav needs at least PHP %s to run.\n", $ver, $req));
}
if (!file_exists(__DIR__ . '/../vendor')){
// Before we can even start, we need to run composer first
echo "Preparing to install vendor dependencies...\n\n";
echo system('php bin/composer.phar --working-dir="'.__DIR__.'/../" --no-interaction install');
echo "\n\n";
}
use Symfony\Component\Console\Application;
require_once(__DIR__ . '/../vendor/autoload.php');

View File

@@ -54,8 +54,7 @@ class InstallCommand extends Command {
if (file_exists($local_config_file)) {
$this->local_config = Yaml::parse($local_config_file);
$output->writeln('');
$output->writeln('read local config from <cyan>' . $local_config_file . '</cyan>');
$output->writeln('Read local config from <cyan>' . $local_config_file . '</cyan>');
}
// Look for dependencies file in ROOT and USER dir
@@ -67,6 +66,10 @@ class InstallCommand extends Command {
$output->writeln('<red>ERROR</red> Missing .dependencies file in <cyan>user/</cyan> folder');
}
// Updates composer first
$output->writeln("\nInstalling vendor dependencies");
$output->writeln(system('php bin/composer.phar --working-dir="'.$this->destination.'" --no-interaction update'));
// If yaml config, process
if ($this->config) {
if (!$input->getOption('symlink')) {