Commit 382b6dab authored by Mike Greiling's avatar Mike Greiling

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
parents a0c48d82 8a3d565c
---
title: Don't use arguments keyword in gettext script
merge_request: 21296
author: gfyoung
type: fixed
......@@ -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);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment