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';