Skip to content

Commit 1353505

Browse files
Michael Blijlevenmartinlindhe
authored andcommitted
Make output messages optional (martinlindhe#62)
1 parent 012424e commit 1353505

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/Commands/GenerateInclude.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ public function handle()
3737
if ($multipleFiles) {
3838
$files = (new Generator($config))
3939
->generateMultiple($root, $umd);
40-
echo "Written to :" . PHP_EOL . $files . PHP_EOL;
40+
41+
if ($config['showOutputMessages']) {
42+
echo "Written to :" . PHP_EOL . $files . PHP_EOL;
43+
}
44+
4145
exit();
4246
}
4347

@@ -47,6 +51,8 @@ public function handle()
4751
$jsFile = base_path() . config('vue-i18n-generator.jsFile');
4852
file_put_contents($jsFile, $data);
4953

50-
echo "Written to " . $jsFile . PHP_EOL;
54+
if ($config['showOutputMessages']) {
55+
echo "Written to " . $jsFile . PHP_EOL;
56+
}
5157
}
5258
}

src/config/vue-i18n-generator.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,15 @@
5252
|
5353
*/
5454
'i18nLib' => 'vue-i18n',
55+
56+
/*
57+
|--------------------------------------------------------------------------
58+
| Output messages
59+
|--------------------------------------------------------------------------
60+
|
61+
| Specify if the library should show "written to" messages
62+
| after generating json files.
63+
|
64+
*/
65+
'showOutputMessages' => false,
5566
];

0 commit comments

Comments
 (0)