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