@hopla/claude-setup 1.3.3 → 1.3.4
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/cli.js +22 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -181,7 +181,15 @@ async function install() {
|
|
|
181
181
|
);
|
|
182
182
|
|
|
183
183
|
log(`\n${CYAN}Installing commands...${RESET}`);
|
|
184
|
-
const
|
|
184
|
+
const allCommandEntries = fs.readdirSync(path.join(FILES_DIR, "commands"));
|
|
185
|
+
const allCommandFiles = allCommandEntries.filter((f) => {
|
|
186
|
+
const stat = fs.statSync(path.join(FILES_DIR, "commands", f));
|
|
187
|
+
return stat.isFile();
|
|
188
|
+
});
|
|
189
|
+
const allCommandDirs = allCommandEntries.filter((f) => {
|
|
190
|
+
const stat = fs.statSync(path.join(FILES_DIR, "commands", f));
|
|
191
|
+
return stat.isDirectory();
|
|
192
|
+
});
|
|
185
193
|
const commandFiles = PLANNING
|
|
186
194
|
? allCommandFiles.filter((f) => PLANNING_COMMANDS.includes(f))
|
|
187
195
|
: allCommandFiles;
|
|
@@ -192,6 +200,19 @@ async function install() {
|
|
|
192
200
|
`~/.claude/commands/${file}`
|
|
193
201
|
);
|
|
194
202
|
}
|
|
203
|
+
// Install subdirectories (e.g. guides/)
|
|
204
|
+
for (const dir of allCommandDirs.sort()) {
|
|
205
|
+
const srcDir = path.join(FILES_DIR, "commands", dir);
|
|
206
|
+
const destDir = path.join(COMMANDS_DIR, dir);
|
|
207
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
208
|
+
for (const file of fs.readdirSync(srcDir).sort()) {
|
|
209
|
+
await installFile(
|
|
210
|
+
path.join(srcDir, file),
|
|
211
|
+
path.join(destDir, file),
|
|
212
|
+
`~/.claude/commands/${dir}/${file}`
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
195
216
|
|
|
196
217
|
log(`\n${GREEN}${BOLD}Done!${RESET} Commands available in any Claude Code session:\n`);
|
|
197
218
|
for (const file of commandFiles.sort()) {
|