@b0tts/template-dev-installer 1.0.2 → 1.0.3
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.mjs +29 -29
- package/package.json +1 -1
package/bin/cli.mjs
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// 4. All — everything above
|
|
12
12
|
// ────────────────────────────────────────────────────────────────────
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import { checkbox, confirm } from "@inquirer/prompts";
|
|
15
15
|
import { cpSync, existsSync } from "node:fs";
|
|
16
16
|
import { resolve, dirname } from "node:path";
|
|
17
17
|
import { fileURLToPath } from "node:url";
|
|
@@ -86,38 +86,38 @@ async function main() {
|
|
|
86
86
|
console.log(" Development Template Installer");
|
|
87
87
|
console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
|
|
88
88
|
|
|
89
|
-
const
|
|
90
|
-
message: "
|
|
89
|
+
const chosen = await checkbox({
|
|
90
|
+
message: "Select categories to install (Space to toggle, Enter to confirm):",
|
|
91
91
|
choices: [
|
|
92
|
-
{ name: "
|
|
93
|
-
{ name: "
|
|
94
|
-
{ name: "
|
|
95
|
-
{ name: "
|
|
92
|
+
{ name: "All", value: "all" },
|
|
93
|
+
{ name: "Skills", value: "skills" },
|
|
94
|
+
{ name: "OpenCode", value: "opencode" },
|
|
95
|
+
{ name: "Pi", value: "pi" },
|
|
96
96
|
],
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
installCategory(
|
|
99
|
+
if (chosen.length === 0) {
|
|
100
|
+
console.log("Nothing selected. Aborted.");
|
|
101
|
+
process.exit(0);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Determine what to install
|
|
105
|
+
const toInstall = chosen.includes("all")
|
|
106
|
+
? Object.keys(CATEGORIES)
|
|
107
|
+
: chosen;
|
|
108
|
+
|
|
109
|
+
const labels = toInstall.map((n) => CATEGORIES[n].label.split(" (")[0]).join(", ");
|
|
110
|
+
const ok = await confirm({
|
|
111
|
+
message: `Install ${labels} into ${CWD}?`,
|
|
112
|
+
default: true,
|
|
113
|
+
});
|
|
114
|
+
if (!ok) {
|
|
115
|
+
console.log("Aborted.");
|
|
116
|
+
process.exit(0);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
for (const name of toInstall) {
|
|
120
|
+
installCategory(name);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
console.log("\n✔ Done.\n");
|
package/package.json
CHANGED