@ztffn/presentation-generator-plugin 1.0.6 → 1.0.8
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/index.js +25 -12
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -101,12 +101,21 @@ async function downloadAndExtract(version, tarballUrl) {
|
|
|
101
101
|
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
function
|
|
105
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
104
|
+
function promptChoice(title, choices) {
|
|
106
105
|
return new Promise((resolve) => {
|
|
107
|
-
|
|
106
|
+
console.log(`\n◆ ${title}`);
|
|
107
|
+
choices.forEach((c, i) => {
|
|
108
|
+
const bullet = i === 0 ? "●" : "○";
|
|
109
|
+
console.log(`│ ${bullet} ${i + 1}) ${c.label}`);
|
|
110
|
+
if (c.hint) console.log(`│ ${c.hint}`);
|
|
111
|
+
});
|
|
112
|
+
console.log("│");
|
|
113
|
+
|
|
114
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
115
|
+
rl.question(`└ Enter choice [1-${choices.length}]: `, (answer) => {
|
|
108
116
|
rl.close();
|
|
109
|
-
|
|
117
|
+
const idx = parseInt(answer.trim(), 10) - 1;
|
|
118
|
+
resolve(idx >= 0 && idx < choices.length ? idx : 0);
|
|
110
119
|
});
|
|
111
120
|
});
|
|
112
121
|
}
|
|
@@ -119,12 +128,18 @@ async function resolveSettingsPath() {
|
|
|
119
128
|
return { settingsPath: userSettingsPath, scope: "user" };
|
|
120
129
|
}
|
|
121
130
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
131
|
+
const idx = await promptChoice("Installation scope", [
|
|
132
|
+
{
|
|
133
|
+
label: "Global",
|
|
134
|
+
hint: "Registered in ~/.claude/settings.json — available in all sessions",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: "Project",
|
|
138
|
+
hint: "Registered in .claude/settings.json — commit to share with your team",
|
|
139
|
+
},
|
|
140
|
+
]);
|
|
141
|
+
|
|
142
|
+
if (idx === 1) {
|
|
128
143
|
return {
|
|
129
144
|
settingsPath: path.join(projectClaudeDir, "settings.json"),
|
|
130
145
|
scope: "project",
|
|
@@ -158,10 +173,8 @@ async function registerPlugin() {
|
|
|
158
173
|
|
|
159
174
|
if (scope === "project") {
|
|
160
175
|
console.log(`Plugin registered in .claude/settings.json ✓`);
|
|
161
|
-
console.log("Commit that file to enable the plugin for your whole team.");
|
|
162
176
|
} else {
|
|
163
177
|
console.log(`Plugin registered in ~/.claude/settings.json ✓`);
|
|
164
|
-
console.log("Available in all your Claude Code sessions.");
|
|
165
178
|
}
|
|
166
179
|
} catch {
|
|
167
180
|
console.log("\nCould not write settings. Add manually to ~/.claude/settings.json:");
|