Files
recflare/packages/tools/src/proc.ts
T
Devin Zuczek 8e644a5c20 Initial commit
2026-06-08 18:23:40 -04:00

21 lines
436 B
TypeScript

export function getOutcome({
exitCode,
skippedCode,
}: {
exitCode: number | null
skippedCode?: number
}) {
if (exitCode === 0) {
return chalk.green('Success!')
} else if (exitCode === skippedCode) {
return chalk.yellow('Skipped')
} else {
return chalk.red(`Failed with code: ${exitCode}`)
}
}
/**
* Non-zero exit code used to indicate "skipped due to shfmt/rg unavailable"
*/
export const SHFMT_SKIPPED_EXIT_CODE = 113