summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Knox <simon@gitlab.com>2018-08-20 04:21:39 +0000
committerSimon Knox <simon@gitlab.com>2018-08-20 04:21:39 +0000
commitb75e36f77abfecc603ffd9b456219ada07b318a4 (patch)
treee3c2353a139fdc0b051475ef17b3fe8012342bc6
parent00baed8cb0725f7e05e6dab4e498acf2b425a5b2 (diff)
downloadgitlab-ce-50457-sast-failure-in-scripts-frontend-extract_gettext_all-js.tar.gz
fix strict-mode syntax error in gettext script50457-sast-failure-in-scripts-frontend-extract_gettext_all-js
-rw-r--r--scripts/frontend/extract_gettext_all.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/frontend/extract_gettext_all.js b/scripts/frontend/extract_gettext_all.js
index af8cc4c3341..a8c040b32d4 100644
--- a/scripts/frontend/extract_gettext_all.js
+++ b/scripts/frontend/extract_gettext_all.js
@@ -7,7 +7,7 @@ const {
} = require('gettext-extractor-vue');
const ensureSingleLine = require('../../app/assets/javascripts/locale/ensure_single_line.js');
-const arguments = argumentsParser
+const { file, all, outputHelp } = argumentsParser
.option('-f, --file <file>', 'Extract message from one single file')
.option('-a, --all', 'Extract message from all js/vue files')
.parse(process.argv);
@@ -61,12 +61,12 @@ function printJson() {
console.log(JSON.stringify(messages));
}
-if (arguments.file) {
- vueParser.parseFile(arguments.file).then(() => printJson());
-} else if (arguments.all) {
+if (file) {
+ vueParser.parseFile(file).then(() => printJson());
+} else if (all) {
vueParser.parseFilesGlob('{ee/app,app}/assets/javascripts/**/*.{js,vue}').then(() => printJson());
} else {
console.warn('ERROR: Please use the script correctly:');
- arguments.outputHelp();
+ outputHelp();
process.exit(1);
}