From d05c049d4c7ff4f0f73fd397d7593f293eb53516 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Fri, 5 Sep 2014 12:58:36 -0700 Subject: [PATCH] Autorun composer install when running the grav cli --- bin/grav | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/grav b/bin/grav index 79015cea1..998b90afc 100755 --- a/bin/grav +++ b/bin/grav @@ -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 -o'); + echo "\n\n"; +} + use Symfony\Component\Console\Application; require_once(__DIR__ . '/../vendor/autoload.php');