Skip to content

feat: add POSIX null command : as a builtin#175

Merged
bartlomieju merged 1 commit into
mainfrom
add-null-command
May 20, 2026
Merged

feat: add POSIX null command : as a builtin#175
bartlomieju merged 1 commit into
mainfrom
add-null-command

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

@bartlomieju bartlomieju commented May 20, 2026

: is POSIX's null command: it discards its arguments and always
exits 0. Bash treats it as a builtin. We had true and false
already; add : alongside them (same ExitCodeCommand(0) underneath).

Without this, deno task for a package.json script defined as
"test": ":" (a common no-op pattern, e.g. used in the aube benchmark
fixture at https://aube.en.dev/benchmarks.html on a ~1400-package
project) fails with :: command not found and exit code 127, while
bash / sh / dash all return 0 cleanly. As a result the benchmark's
install-test scenario for Deno can never complete.

Adds an integration test covering the bare :, argument discarding,
and && / || short-circuit behavior.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 20, 2026

CLA assistant check
All committers have signed the CLA.

`:` is POSIX's null command: it discards its arguments and always
exits 0. Bash treats it as a builtin. We had `true` and `false`
already; add `:` alongside them (same `ExitCodeCommand(0)` underneath).

Without this, `deno task` for a `package.json` script defined as
`"test": ":"` (a common no-op pattern, e.g. used in the aube
benchmark fixture's ~1400-package project) fails with
`:: command not found` and exit code 127, while bash / sh / dash
all return 0 cleanly.

Adds an integration test covering the bare `:`, argument discarding,
and `&&` / `||` short-circuit behavior.
@bartlomieju bartlomieju merged commit 9726210 into main May 20, 2026
3 checks passed
bartlomieju added a commit to denoland/deno that referenced this pull request May 20, 2026
Picks up denoland/deno_task_shell#175, which adds the POSIX `:` (null
command) as a shell builtin alongside `true` and `false`. Without it
`deno task` fails with `:: command not found` (exit 127) on any
package.json whose script is the bare colon no-op, e.g. the
`"test": ":"` script in the aube benchmark fixture
(https://aube.en.dev/benchmarks.html) that previously prevented Deno
from completing the install-test scenario at all. Verified locally:
`deno task test` against a minimal `{ "scripts": { "test": ":" } }`
package now exits 0.
bartlomieju added a commit to denoland/deno that referenced this pull request May 20, 2026
Picks up two upstream changes in deno_task_shell: support for `set -e`
/ `set +e` (and the `set -o errexit` long form), which aborts the
surrounding sequential list on the first non-zero exit, and the POSIX
null command `:` as a builtin.

See denoland/deno_task_shell#171 and denoland/deno_task_shell#175.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants