Download src/cli/exit.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 478 Bytes
-
https://huggingface.co/chenbhao/codev/resolve/main/src/cli/exit.ts
- Command line
-
hf download hf://chenbhao/codev/src/cli/exit.ts
-
curl -L -o exit.ts https://huggingface.co/chenbhao/codev/resolve/main/src/cli/exit.ts
478 Bytes
| /** | |
| * Exit handler | |
| * This handler is used to exit the CLI with a status code | |
| */ | |
| export function exit(): never { | |
| process.exit(0); | |
| } | |
| export function exitWithError(message: string, code: number = 1): never { | |
| console.error(message); | |
| process.exit(code); | |
| } | |
| export function cliError(message: string): never { | |
| console.error(message); | |
| process.exit(1); | |
| } | |
| export function cliOk(message?: string): never { | |
| if (message) { | |
| console.log(message); | |
| } | |
| process.exit(0); | |
| } |