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

Function parseArgs

scripts/publish-packages.ts:46–61  ·  view source on GitHub ↗
(argv: ReadonlyArray<string>)

Source from the content-addressed store, hash-verified

44] as const;
45
46const parseArgs = (argv: ReadonlyArray<string>): { dryRun: boolean; prepareOnly: boolean } => {
47 let dryRun = false;
48 let prepareOnly = false;
49 for (const arg of argv) {
50 if (arg === "--dry-run") {
51 dryRun = true;
52 continue;
53 }
54 if (arg === "--prepare-only") {
55 prepareOnly = true;
56 continue;
57 }
58 throw new Error(`Unknown argument: ${arg}`);
59 }
60 return { dryRun, prepareOnly };
61};
62
63const resolveChannel = (version: string): Channel => (version.includes("-") ? "beta" : "latest");
64

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected