@ztffn/presentation-generator-plugin 1.0.6 → 1.0.7
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 +28 -11
- 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,7 +173,9 @@ async function registerPlugin() {
|
|
|
158
173
|
|
|
159
174
|
if (scope === "project") {
|
|
160
175
|
console.log(`Plugin registered in .claude/settings.json ✓`);
|
|
161
|
-
console.log(
|
|
176
|
+
console.log(
|
|
177
|
+
"Each teammate still needs to run: npx @ztffn/presentation-generator-plugin install"
|
|
178
|
+
);
|
|
162
179
|
} else {
|
|
163
180
|
console.log(`Plugin registered in ~/.claude/settings.json ✓`);
|
|
164
181
|
console.log("Available in all your Claude Code sessions.");
|