Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

projectScriptsCopy.ts

17 lines615 Bytes

1import type { ProjectScript } from "@t3tools/contracts";
2import { mFallback, msg } from "gt-i18n";
3import type { MFunctionType } from "gt-i18n/types";
4​
5/** @public */
6export 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;