The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type { ProjectScript } from "@t3tools/contracts"; |
| 2 | import { mFallback, msg } from "gt-i18n"; |
| 3 | import type { MFunctionType } from "gt-i18n/types"; |
| 4 | |
| 5 | /** @public */ |
| 6 | export function projectScriptMenuLabel( |
| 7 | script: ProjectScript, |
| 8 | resolve: MFunctionType = mFallback, |
| 9 | ): string { |
| 10 | const name = script.name; |
| 11 | if (script.runOnWorktreeCreate && script.runOnSettle) { |
| 12 | return resolve(msg("{name} (setup, on settle)", { name })); |
| 13 | } |
| 14 | if (script.runOnWorktreeCreate) return resolve(msg("{name} (setup)", { name })); |
| 15 | if (script.runOnSettle) return resolve(msg("{name} (on settle)", { name })); |
| 16 | return name; |
| 17 | } |