@rpcbase/server 0.230.0 → 0.232.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/check_args.js +13 -8
- package/package.json +1 -1
package/cli/check_args.js
CHANGED
|
@@ -5,16 +5,21 @@ const check_args = (args) => {
|
|
|
5
5
|
throw new Error("Did you mean --sessions?")
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
try {
|
|
9
|
+
const {npm_config_argv} = process.env
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
// if not started from npm (ie: docker) this var is not set, we assume args are correct
|
|
12
|
+
if (!npm_config_argv) {
|
|
13
|
+
console.warn("no npm_config_argv skipping arg check")
|
|
14
|
+
return
|
|
15
|
+
}
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
const raw_args = JSON.parse(npm_config_argv).original
|
|
18
|
+
if (raw_args.indexOf("--no-session") > -1) {
|
|
19
|
+
throw new Error("Did you mean --no-sessions?")
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
console.log("ERROR CHECKING ARGS", raw_args)
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
return true
|