Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Add root path to artisan command #115 #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/Commands/GenerateInclude.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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';
Expand Down