MCPcopy Create free account
hub / github.com/chakra-ui/panda / parseArgs

Function parseArgs

scripts/setup-trusted-publishing.mjs:213–225  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

211}
212
213function parseArgs(argv) {
214 const out = { dryRun: false, firstPublish: false, yes: false }
215 for (let i = 0; i < argv.length; i++) {
216 const a = argv[i]
217 if (a === '--dry-run') out.dryRun = true
218 else if (a === '--first-publish') out.firstPublish = true
219 else if (a === '--yes' || a === '-y') out.yes = true
220 else if (a === '--repo') out.repo = argv[++i]
221 else if (a === '--file') out.file = argv[++i]
222 else fail(`Unknown argument: ${a}`)
223 }
224 return out
225}
226
227function run(cmd, cmdArgs, opts = {}) {
228 return execFileSync(cmd, cmdArgs, { stdio: 'inherit', ...opts })

Callers 1

Calls 1

failFunction · 0.85

Tested by

no test coverage detected