From 26ae024466581ee537d66a686d70555ff645438e Mon Sep 17 00:00:00 2001 From: Alexander Helmich Date: Fri, 6 Mar 2020 10:16:48 +0100 Subject: [PATCH] resolves martinlindhe/laravel-vue-i18n-generator #115 --- src/Commands/GenerateInclude.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Commands/GenerateInclude.php b/src/Commands/GenerateInclude.php index 30fb23d..efad153 100644 --- a/src/Commands/GenerateInclude.php +++ b/src/Commands/GenerateInclude.php @@ -11,7 +11,7 @@ class GenerateInclude extends Command * * @var string */ - protected $signature = 'vue-i18n:generate {--umd} {--multi} {--with-vendor} {--file-name=} {--lang-files=} {--format=es6} {--multi-locales}'; + protected $signature = 'vue-i18n:generate {--umd} {--multi} {--with-vendor} {--file-name=} {--lang-files=} {--format=es6} {--multi-locales} {--root-path=}'; /** * The console command description. @@ -27,7 +27,7 @@ class GenerateInclude extends Command */ public function handle() { - $root = base_path() . config('vue-i18n-generator.langPath'); + $root = $this->option('root-path'); $config = config('vue-i18n-generator'); // options @@ -39,6 +39,12 @@ public function handle() $format = $this->option('format'); $multipleLocales = $this->option('multi-locales'); + if( $root == null || empty($root) ){ + $root = config('vue-i18n-generator.langPath'); + } + + $root = base_path() . $root; + if ($umd) { // if the --umd option is set, set the $format to 'umd' $format = 'umd';