Commit 8a3d565c authored by gfyoung's avatar gfyoung

Don't use arguments keyword in gettext script

Causing SAST build to fail unnecessarily.

Follow-up to !19378.
parent d195ee8f
---
title: Don't use arguments keyword in gettext script
merge_request: 21296
author: gfyoung
type: fixed
...@@ -7,7 +7,7 @@ const { ...@@ -7,7 +7,7 @@ const {
} = require('gettext-extractor-vue'); } = require('gettext-extractor-vue');
const ensureSingleLine = require('../../app/assets/javascripts/locale/ensure_single_line.js'); 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('-f, --file <file>', 'Extract message from one single file')
.option('-a, --all', 'Extract message from all js/vue files') .option('-a, --all', 'Extract message from all js/vue files')
.parse(process.argv); .parse(process.argv);
...@@ -61,12 +61,12 @@ function printJson() { ...@@ -61,12 +61,12 @@ function printJson() {
console.log(JSON.stringify(messages)); console.log(JSON.stringify(messages));
} }
if (arguments.file) { if (args.file) {
vueParser.parseFile(arguments.file).then(() => printJson()); vueParser.parseFile(args.file).then(() => printJson());
} else if (arguments.all) { } else if (args.all) {
vueParser.parseFilesGlob('{ee/app,app}/assets/javascripts/**/*.{js,vue}').then(() => printJson()); vueParser.parseFilesGlob('{ee/app,app}/assets/javascripts/**/*.{js,vue}').then(() => printJson());
} else { } else {
console.warn('ERROR: Please use the script correctly:'); console.warn('ERROR: Please use the script correctly:');
arguments.outputHelp(); args.outputHelp();
process.exit(1); 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