( subcommand: string, rest: string[], cwd: string, stderr: (text: string) => void )
| 422 | } |
| 423 | |
| 424 | const 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 | |
| 452 | const hasArkPrecompileSetting = ( |
| 453 | manifest: PackageManifest | undefined |
no test coverage detected