MCPcopy Create free account
hub / github.com/arktypeio/arktype / runAot

Function runAot

ark/type/cli.ts:424–450  ·  view source on GitHub ↗
(
	subcommand: string,
	rest: string[],
	cwd: string,
	stderr: (text: string) => void
)

Source from the content-addressed store, hash-verified

422}
423
424const runAot = (
425 subcommand: string,
426 rest: string[],
427 cwd: string,
428 stderr: (text: string) => void
429): number => {
430 const lookupCwd = explicitCwdOf(rest, cwd)
431 const cliPath =
432 (lookupCwd ? resolveAotCli(lookupCwd) : undefined) ?? resolveAotCli(cwd)
433 if (!cliPath) {
434 const pm = detectPackageManager(cwd)
435 const spec =
436 arktypeManifest.arkAotVersion ?
437 `@ark/aot@${arktypeManifest.arkAotVersion}`
438 : "@ark/aot"
439 stderr(
440 `@ark/aot is not installed. Install it to run \`ark ${subcommand}\`:\n\n ${installDevCommand(pm, spec)}\n`
441 )
442 return 1
443 }
444 const result = spawnSync(
445 process.execPath,
446 [cliPath, `--${subcommand}`, ...rest],
447 { cwd, stdio: "inherit" }
448 )
449 return result.status ?? 1
450}
451
452const hasArkPrecompileSetting = (
453 manifest: PackageManifest | undefined

Callers 1

runCliFunction · 0.85

Calls 4

explicitCwdOfFunction · 0.85
resolveAotCliFunction · 0.85
detectPackageManagerFunction · 0.85
installDevCommandFunction · 0.85

Tested by

no test coverage detected