MCPcopy Create free account
hub / github.com/acoyfellow/cloudbox / readArg

Function readArg

scripts/cloudbox-live-sync.mjs:36–42  ·  view source on GitHub ↗
(flag)

Source from the content-addressed store, hash-verified

34process.on("SIGTERM", stop);
35
36function readArg(flag) {
37 const index = args.indexOf(flag);
38 if (index === -1) return null;
39 const value = args[index + 1];
40 if (!value || value.startsWith("--")) throw new Error(`${flag} needs a value`);
41 return value;
42}
43
44async function readStateRunId() {
45 const statePath = new URL(`file://${process.cwd()}/.cloudbox-live.json`);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected