()
| 16 | |
| 17 | /** Current git branch, or undefined on detached HEAD / outside a repo. */ |
| 18 | export function gitBranch(): string | undefined { |
| 19 | const r = spawnSync("git", ["rev-parse", "--abbrev-ref", "HEAD"], { encoding: "utf-8" }); |
| 20 | const b = (r.stdout || "").trim(); |
| 21 | return b && b !== "HEAD" ? b : undefined; |
| 22 | } |
| 23 | |
| 24 | /** The value following `--flag` in argv, or undefined if absent. */ |
| 25 | export function flagValue(args: string[], name: string): string | undefined { |
nothing calls this directly
no test coverage detected