@reliverse/rempts 1.7.19 → 1.7.21
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.
|
@@ -675,21 +675,15 @@ async function runCommandWithArgs(command, argv, parserOptions, returnCtx) {
|
|
|
675
675
|
if (autoExit) process.exit(1);
|
|
676
676
|
else throw new Error(`Missing required argument: --${key}`);
|
|
677
677
|
}
|
|
678
|
-
if (def.dependencies && Array.isArray(def.dependencies)) {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
if (autoExit) process.exit(1);
|
|
688
|
-
else
|
|
689
|
-
throw new Error(
|
|
690
|
-
`Argument --${key} requires --${dependency} to be set`
|
|
691
|
-
);
|
|
692
|
-
}
|
|
678
|
+
if (def.dependencies && Array.isArray(def.dependencies) && rawVal !== void 0) {
|
|
679
|
+
const missingDeps = def.dependencies.filter(
|
|
680
|
+
(dependency) => !(parsed[dependency] ?? defaultMap[dependency])
|
|
681
|
+
);
|
|
682
|
+
if (missingDeps.length > 0) {
|
|
683
|
+
const depsList = missingDeps.map((d) => `--${d}`).join(", ");
|
|
684
|
+
throw new Error(
|
|
685
|
+
`Argument --${key} can only be used when ${depsList} ${missingDeps.length === 1 ? "is" : "are"} set`
|
|
686
|
+
);
|
|
693
687
|
}
|
|
694
688
|
}
|
|
695
689
|
try {
|
|
@@ -897,13 +891,14 @@ export async function runCmd(command, argv = [], parserOptions = {}) {
|
|
|
897
891
|
throw new Error(`Missing required argument: --${key}`);
|
|
898
892
|
}
|
|
899
893
|
if (def.dependencies && Array.isArray(def.dependencies)) {
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
894
|
+
const missingDeps = def.dependencies.filter(
|
|
895
|
+
(dependency) => !(parsed[dependency] ?? defaultMap[dependency])
|
|
896
|
+
);
|
|
897
|
+
if (missingDeps.length > 0) {
|
|
898
|
+
const depsList = missingDeps.map((d) => `--${d}`).join(", ");
|
|
899
|
+
throw new Error(
|
|
900
|
+
`Argument --${key} can only be used when ${depsList} ${missingDeps.length === 1 ? "is" : "are"} set`
|
|
901
|
+
);
|
|
907
902
|
}
|
|
908
903
|
}
|
|
909
904
|
try {
|