diff --git a/SettingsHelper.js b/SettingsHelper.js index aace8042..dc41412c 100644 --- a/SettingsHelper.js +++ b/SettingsHelper.js @@ -1,4 +1,4 @@ -const args = require('args-parser')(process.argv); +const argv = require('minimist')(process.argv.slice(2)); const { coalesce } = require('./src/utils/helpers'); @@ -191,12 +191,12 @@ module.exports = { for (let i = 0; i < fields.length; i++) { const setting = fields[i]; // console.log('Processing setting', setting); - // console.log(`Args: '${args[setting.env]}'; '${args[setting.local]}'`); + // console.log(`Args: '${argv[setting.env]}'; '${argv[setting.local]}'`); // console.log(`ENV: '${process.env[setting.env]}'; '${process.env[setting.local]}'`); // console.log(`Settings: '${settings[setting.local]}'; '${setting.default}'`); const value = coalesce( - args[setting.env], - args[setting.local], + argv[setting.env], + argv[setting.local], process.env[setting.env], process.env[setting.local], settings[setting.env], @@ -207,7 +207,7 @@ module.exports = { // Backwards compatibilty for PORT ENV setting if (setting.local === 'webapp_port' && output[setting.local] === 8088) { - const port = args.PORT || process.env.PORT || settings.PORT; + const port = argv.PORT || process.env.PORT || settings.PORT; if (port && port !== 8088) { console.log(`Please change 'PORT' to 'WEB_PORT'. Setting WEB_PORT to '${port}'`); output[setting.local] = port; diff --git a/package-lock.json b/package-lock.json index 665e50b8..cf35b248 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2854,11 +2854,6 @@ "sprintf-js": "~1.0.2" } }, - "args-parser": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/args-parser/-/args-parser-1.1.0.tgz", - "integrity": "sha1-YlO/zWlNJ5/mPqr9eNYo0UoF/6k=" - }, "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", @@ -8301,8 +8296,7 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "minipass": { "version": "3.1.3", diff --git a/package.json b/package.json index e6c6e68d..6a3acbc9 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,10 @@ "start": "node server.js" }, "dependencies": { - "args-parser": "^1.1.0", "core-js": "^3.6.5", "cors": "^2.8.5", "express": "^4.17.1", + "minimist": "^1.2.5", "socket.io": "^2.3.0", "vue": "^2.6.11", "vue-router": "^3.3.4",