onBranch

tcmts.cli.mcp.onBranch · #samw7gnd · term · runs anywhere

A read command's arguments with --branch <branch> (after the command's name: before a --), if it's given.

export const onBranch = (argv: string[], branch: string | undefined): string[] =>
  branch ? [argv[0]!, "--branch", branch, ...argv.slice(1)] : argv

used by