Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/targets/droid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ export async function writeDroidBundle(outputRoot: string, bundle: DroidBundle):
if (bundle.commands.length > 0) {
await ensureDir(paths.commandsDir)
for (const command of bundle.commands) {
await writeText(path.join(paths.commandsDir, `${command.name}.md`), command.content + "\n")
// Split colon-separated names into nested directories (e.g. "ce:plan" -> "ce/plan.md")
// to avoid colons in filenames which are invalid on Windows/NTFS
const parts = command.name.split(":")
if (parts.length > 1) {
const nestedDir = path.join(paths.commandsDir, ...parts.slice(0, -1))
await ensureDir(nestedDir)
await writeText(path.join(nestedDir, `${parts[parts.length - 1]}.md`), command.content + "\n")
} else {
await writeText(path.join(paths.commandsDir, `${command.name}.md`), command.content + "\n")
}
}
}

Expand Down
11 changes: 10 additions & 1 deletion src/targets/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ export async function writeGeminiBundle(outputRoot: string, bundle: GeminiBundle

if (bundle.commands.length > 0) {
for (const command of bundle.commands) {
await writeText(path.join(paths.commandsDir, `${command.name}.toml`), command.content + "\n")
// Split colon-separated names into nested directories (e.g. "ce:plan" -> "ce/plan.toml")
// to avoid colons in filenames which are invalid on Windows/NTFS
const parts = command.name.split(":")
if (parts.length > 1) {
const nestedDir = path.join(paths.commandsDir, ...parts.slice(0, -1))
await ensureDir(nestedDir)
await writeText(path.join(nestedDir, `${parts[parts.length - 1]}.toml`), command.content + "\n")
} else {
await writeText(path.join(paths.commandsDir, `${command.name}.toml`), command.content + "\n")
}
}
}

Expand Down
12 changes: 11 additions & 1 deletion src/targets/opencode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,17 @@ export async function writeOpenCodeBundle(outputRoot: string, bundle: OpenCodeBu
}

for (const commandFile of bundle.commandFiles) {
const dest = path.join(openCodePaths.commandDir, `${commandFile.name}.md`)
// Split colon-separated names into nested directories (e.g. "ce:plan" -> "ce/plan.md")
// to avoid colons in filenames which are invalid on Windows/NTFS
const parts = commandFile.name.split(":")
let dest: string
if (parts.length > 1) {
const nestedDir = path.join(openCodePaths.commandDir, ...parts.slice(0, -1))
await ensureDir(nestedDir)
dest = path.join(nestedDir, `${parts[parts.length - 1]}.md`)
} else {
dest = path.join(openCodePaths.commandDir, `${commandFile.name}.md`)
}
const cmdBackupPath = await backupFile(dest)
if (cmdBackupPath) {
console.log(`Backed up existing command file to ${cmdBackupPath}`)
Expand Down
Loading