diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-08-21 18:54:56 +0000 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-08-21 18:54:56 +0000 |
commit | 382b6dabd96e8966386729d82854b899ad4ce894 (patch) | |
tree | 164345c86a4304e4b6c5fc0a61a4161654c79da9 | |
parent | a0c48d82e143b25913b977c526cb196daf517ad6 (diff) | |
parent | 8a3d565c8e13cf30c48958b9dcc8142feee39322 (diff) | |
download | gitlab-ce-382b6dabd96e8966386729d82854b899ad4ce894.tar.gz |
Merge branch 'arguments-keyword-sast' into 'master'
Don't use arguments keyword in gettext script
Closes #50457
See merge request gitlab-org/gitlab-ce!21296
-rw-r--r-- | changelogs/unreleased/arguments-keyword-sast.yml | 5 | ||||
-rw-r--r-- | scripts/frontend/extract_gettext_all.js | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/changelogs/unreleased/arguments-keyword-sast.yml b/changelogs/unreleased/arguments-keyword-sast.yml new file mode 100644 index 00000000000..2ecbc5e8174 --- /dev/null +++ b/changelogs/unreleased/arguments-keyword-sast.yml @@ -0,0 +1,5 @@ +--- +title: Don't use arguments keyword in gettext script +merge_request: 21296 +author: gfyoung +type: fixed diff --git a/scripts/frontend/extract_gettext_all.js b/scripts/frontend/extract_gettext_all.js index af8cc4c3341..725522a3540 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 args = 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 (args.file) { + vueParser.parseFile(args.file).then(() => printJson()); +} else if (args.all) { vueParser.parseFilesGlob('{ee/app,app}/assets/javascripts/**/*.{js,vue}').then(() => printJson()); } else { console.warn('ERROR: Please use the script correctly:'); - arguments.outputHelp(); + args.outputHelp(); process.exit(1); } |