new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Deno · all subjects

cli/exit-codes

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Deno.exit() terminates immediately with exit code

Deno.exit() terminates the process immediately with the given exit code. Zero means success, anything else means failure. Because it stops the process on the spot, pending work like flushing logs or finally blocks never runs.

Deno.exitCode sets exit code but continues execution

Deno.exitCode sets the exit code without terminating immediately. The process continues, finishes naturally, and then exits with the code you set. This is the right pattern for linters and batch tools that should report every problem rather than stop at the first one.

Exit code convention: 1 for tool errors, 2 for usage mistakes

There is no fixed meaning for nonzero exit codes beyond failure, but a common convention is 1 for errors your tool checks for and 2 for usage mistakes like missing arguments.

Example: set Deno.exitCode for batch tools

for (const file of Deno.args) { try { await Deno.lstat(file); } catch { console.error(`Missing: ${file}`); Deno.exitCode = 1; } } console.log("Check finished");

deno doc --lint exit status

When 'deno doc --lint' finds any errors, the command exits with a non-zero status code, making it safe to use in CI steps or 'deno task' entries where the build should fail if documentation issues exist.

Give your agent this brain