From ba0379aacc4bd027ddfb1c3f1cb8c8b0ca0c0494 Mon Sep 17 00:00:00 2001 From: Achmad Fatoni Date: Wed, 18 Oct 2017 22:58:49 +0700 Subject: [PATCH] #10 create artisan command to composer install --- src/Commands/ComposerInstall.php | 36 ++++++++++++++++++++++++++ src/LaravelGitHooksServiceProvider.php | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 src/Commands/ComposerInstall.php diff --git a/src/Commands/ComposerInstall.php b/src/Commands/ComposerInstall.php new file mode 100644 index 0000000..ebc517e --- /dev/null +++ b/src/Commands/ComposerInstall.php @@ -0,0 +1,36 @@ +warn('composer not installed'); + return; + } + exec($composerCommand . ' install'); + } +} diff --git a/src/LaravelGitHooksServiceProvider.php b/src/LaravelGitHooksServiceProvider.php index 7ea0bcb..c7444a1 100644 --- a/src/LaravelGitHooksServiceProvider.php +++ b/src/LaravelGitHooksServiceProvider.php @@ -2,6 +2,7 @@ namespace Feek\LaravelGitHooks; +use Feek\LaravelGitHooks\Commands\ComposerInstall; use Feek\LaravelGitHooks\Commands\ESLint; use Feek\LaravelGitHooks\Commands\Phpcs; use Feek\LaravelGitHooks\Commands\Phpcbf; @@ -22,6 +23,7 @@ public function boot() { if ($this->app->runningInConsole()) { $this->commands([ + ComposerInstall::class, ESLint::class, Phpcs::class, Phpcbf::class,