bi-agent-kit 0.1.0 → 0.1.1
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/bin/cli.js +31 -9
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -690,15 +690,37 @@ async function runInstallFlow(parsed) {
|
|
|
690
690
|
value: group.absPath,
|
|
691
691
|
label: labelForTargetIds(group.targetIds) + " (" + group.absPath + ")",
|
|
692
692
|
}));
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
693
|
+
let chosenTargets;
|
|
694
|
+
// Re-prompt loop: selecting no target when servers ARE chosen installs
|
|
695
|
+
// nothing (raw = chosenServers x chosenTargets, empty targets => empty),
|
|
696
|
+
// which is almost never intended -- warn and re-ask, with a confirm escape
|
|
697
|
+
// hatch so a user who really wants to write nothing can still proceed.
|
|
698
|
+
for (;;) {
|
|
699
|
+
chosenTargets = await clack.multiselect({
|
|
700
|
+
message: "Select which detected config files to install into",
|
|
701
|
+
options: targetOptions,
|
|
702
|
+
initialValues: groups.map((g) => g.absPath).filter((absPath) => previousAbsPaths.has(absPath)),
|
|
703
|
+
required: false,
|
|
704
|
+
});
|
|
705
|
+
if (clack.isCancel(chosenTargets)) {
|
|
706
|
+
clack.cancel("Cancelled.");
|
|
707
|
+
process.exit(1);
|
|
708
|
+
}
|
|
709
|
+
if (chosenServers.length === 0 || chosenTargets.length > 0) break;
|
|
710
|
+
|
|
711
|
+
clack.log.warn(
|
|
712
|
+
"You selected " + chosenServers.length + " server(s) but no config file to install into -- " +
|
|
713
|
+
"nothing would be written and no setup steps would run."
|
|
714
|
+
);
|
|
715
|
+
const proceedAnyway = await clack.confirm({
|
|
716
|
+
message: "Install nothing and exit?",
|
|
717
|
+
initialValue: false,
|
|
718
|
+
});
|
|
719
|
+
if (clack.isCancel(proceedAnyway)) {
|
|
720
|
+
clack.cancel("Cancelled.");
|
|
721
|
+
process.exit(1);
|
|
722
|
+
}
|
|
723
|
+
if (proceedAnyway) break;
|
|
702
724
|
}
|
|
703
725
|
|
|
704
726
|
const { raw, reconfigured } = await resolveInteractiveSelections({
|