This commit is contained in:
Yuri Kuznetsov
2023-05-02 18:06:33 +03:00
parent 81ac053818
commit 9a6cfd4228
2 changed files with 23 additions and 20 deletions

19
po.js
View File

@@ -41,26 +41,27 @@ const PO = require('./js/po');
const path = require('path');
const fs = require('fs');
var language = process.argv[2] || null;
let language = process.argv[2] || null;
let onlyModuleName = null;
var onlyModuleName = null;
if (process.argv.length > 2) {
for (var i in process.argv) {
for (let i in process.argv) {
if (~process.argv[i].indexOf('--module=')) {
onlyModuleName = process.argv[i].substr(('--module=').length);
}
if (~process.argv[i].indexOf('--all')) {
language = '--all';
}
}
}
var espoPath = path.dirname(fs.realpathSync(__filename)) + '';
let espoPath = path.dirname(fs.realpathSync(__filename)) + '';
var po = new PO(espoPath, language, onlyModuleName);
let po = new PO(espoPath, language, onlyModuleName);
if (language === '--all') {
po.runAll();
} else {
language === '--all' ?
po.runAll() :
po.run();
}