MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / parseArgs

Function parseArgs

apps/cli/src/release.ts:33–46  ·  view source on GitHub ↗
(argv: ReadonlyArray<string>)

Source from the content-addressed store, hash-verified

31 /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
32
33const parseArgs = (argv: ReadonlyArray<string>): ReleaseCliOptions => {
34 let dryRun = false;
35
36 for (const arg of argv) {
37 if (arg === "--dry-run") {
38 dryRun = true;
39 continue;
40 }
41
42 throw new Error(`Unknown argument: ${arg}`);
43 }
44
45 return { dryRun };
46};
47
48const runCommand = async (input: CommandInput): Promise<CommandOutput> => {
49 const proc = Bun.spawn([input.command, ...input.args], {

Callers 2

mainFunction · 0.70
build.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected