Repository navigation
just-bash@3.6.0
Minor Changes
-
#377
cc35fabThanks @trieloff! - Add themktempcommand. It creates a unique temporary file (mode 0600) or directory (-d, mode 0700) and prints its path, supporting-p/--tmpdir[=DIR],-t,-u/--dry-run,-q/--quiet,--suffix=SUFF, GNU-styleTEMPLATEexpansion,--helpand--version. The default directory is$TMPDIRwhen set and non-empty, otherwise/tmp, so sandboxed embedders that pointTMPDIRat a writable directory get a usable path. Random name characters come from the platform CSPRNG (crypto.getRandomValues), and existing paths are never returned.Adds an optional
createExclusive(path, { mode, directory })method toIFileSystem, which creates an entry only if the name is free and applies the mode at creation time rather than via a follow-upchmod. All built-in filesystems implement it. The member is optional, so externalIFileSystemimplementations remain source compatible;mktempreports that such a filesystem cannot create atomically rather than substituting a non-atomic sequence. The accompanyingCreateExclusiveOptionstype is exported alongside the existingMkdirOptions/RmOptions. -
#409
5d19cc3Thanks @trieloff! - Add theyescommand.yes [STRING]...repeats a line built from its operands (ywhen there are none), soyes | head -3andyes | some-promptwork instead of failing with exit 127. Because pipeline stages here run to completion rather than streaming, the stream is finite: it ends afterexecutionLimits.maxLoopIterationslines, or earlier if the repeated line would exceed the output size limit.
Patch Changes
-
#445
7313062Thanks @trieloff! - interpreter: preserve complete associative-array values indeclare -Acompound assignmentsQuoted values containing whitespace were reconstructed without quoting before the
declarebuiltin parsed them, so every value was silently truncated at its first space. Associative-array declarations now retain whitespace and other quoted content. -
#346
52a5617Thanks @iroiro147! - fs: keep the Buffer-lessfromBufferfallback under the argument limitWithout
Buffer(for example in a Chrome extension service worker),fromBufferconvertedbase64,binaryandlatin1content by spreading 64KB chunks intoString.fromCharCode, which can exceed the engine's argument limit and throwRangeError: Maximum call stack size exceededon a 64KBcat. The fallback now converts in 8KB chunks. -
#443
a36c324Thanks @RyanGarber! - Handle accessor descriptors when installing module defense-in-depth proxies on Bun, preserving blocking behavior and original descriptors on teardown. -
#414
31ac823Thanks @mutewinter! - find: report a directory it cannot read and keep goingA
readdirfailure inside the traversal threw out of the whole search, so one unreadable directory endedfindwith no results: exit 1 andfind: EACCES: permission denied, scandir '<path>'on its own, and exit 0 with nothing at all once piped throughheadwith stderr silenced. Every macOS home directory holds such a directory (.Trash, several underLibrary), so a recursivefindover a mounted home directory never returned anything.GNU find names the directory on stderr, continues with everything else, and exits 1 at the end. It now does the same here. The message is
find: <path>: Permission denied, with the phrase taken from the errno alone, so nothing from the underlying error's text reaches the output. A failure that is not one of the errnos a directory read can produce (a cancellation, an execution limit, a filesystem policy refusal) still ends the search as before.Messages are emitted in traversal order beside the node's own output, whatever order the parallel batch settled in, and a failed read still counts toward the trace's
readdirCallsandreaddirTime. -
#384
e0cca16Thanks @taoche! - Match real jq behavior forto_entrieson arrays (numeric-key entries instead of null) andtonumberon empty or whitespace-only strings (error instead of 0). -
#417
017a911Thanks @trieloff! - interpreter: give a loop left viabreak/continuestatus 0 instead of the last command'sbreakandcontinueare builtins that return 0, and they are the last command a loop body runs. A loop exited through them reported the status of whatever ran before thebreakinstead:while :; do false; break; done; echo $? # was 1, bash says 0 for i in 1; do false; break; done; echo $? # was 1, bash says 0 for i in 1 2; do false; continue; done; echo $? # was 1, bash says 0
All four loop forms were affected —
for, C-stylefor,while,until— as was abreak/continuein awhilecondition and a multi-levelbreak 2unwinding through an enclosing loop.The stale status is invisible until something reads
$?, and underset -ethe phantom failing loop ends the script with no output and no diagnostic:set -euo pipefail while :; do [ 5 -eq 0 ] && break # correctly exempt from errexit as the left operand of && break done echo ok # never ran
$?moves with the status, so the next iteration sees it too — aforloop runs nothing between thecontinueand the next iteration's first command, and would otherwise still expose the failure there:for i in 1 2; do echo "$i:$?"; false; continue; done # was 1:0 2:1, bash says 1:0 2:0
continuesets the status at the point it runs but does not pin it: a later iteration still overwrites it, sofor i in 1 2; do if [ $i = 1 ]; then true; continue; fi; false; doneis still 1. A loop that ends normally is unchanged and reports its last command, andreturnfrom a function still reports the last command rather than 0.Reported downstream as ai-ecoverse/slicc#2978.
-
#488
c21d678Thanks @FredAmartey! - GiveMountableFssynchronousmkdirSyncandwriteFileSync, routed to the filesystem that owns the path, soBashsets up/bin,/dev,/proc,/tmpand the working directory in its base. Paths on a filesystem without synchronous writes throwENOSYSand are left out of the layout. -
#416
4af0dc0Thanks @trieloff! - Fix default, assignment, and alternative parameter expansions used as an entire double-quoted word underset -u. For example,echo "${U:-fallback}"now printsfallbackwhenUis unset instead of reporting "unbound variable". This also lets scripts safely check optional CI variables such asGITHUB_STEP_SUMMARY. -
#509
632090aThanks @janneh! - Bundle the patchedsmol-toml1.9.0.The Node bundle inlines
smol-toml, so a consumer can't pick up its fix through its own lockfile. Only a just-bash release carries it. -
#444
128feaaThanks @RyanGarber! - Use a virtual executable name for CPython instead of the host worker path, avoiding script finalization failures under long installation paths without weakening worker protections. -
#314
90df057Thanks @tylergibbs1! - Repeatedgrep -eoptions overwrote the earlier patterns, so only the last one was used. All-epatterns now combine. -
#503
130da94Thanks @asafyish! - Host operations that settle after a cancelled execution no longer surface as a process-levelunhandledRejection.Aborting or timing out an execution while the worker bridge was awaiting a host tool (or an
exec) left that operation to settle after the defense-in-depth box deactivated. The box'sPromise.prototype.thenguard, which blocks sandbox callbacks once their execution ends, then dropped the handlers meant to consume that result: a late rejection crashed processes that treat unhandled rejections as fatal, and a late success never reached the bridge. Host-side settlement now goes throughawait, which bypasses the guardedthen. -
#487
0353b22Thanks @FredAmartey! - Keep leading blanks aftera\,i\andc\insedtext, as GNU does, including blanks escaped with a backslash. The one-linea textform now strips every leading blank instead of only the first. -
#513
ef8c75dThanks @jamalkamaladdin! - Fix intermittentpython3failures withOSError: [Errno 29] I/O erroron a busy host. A wakeup left over from the previous bridge call could end the wait for the next call before the main thread answered it. The worker now keeps waiting until the call is answered, within the same operation timeout. -
#506
4ee035bThanks @privatenumber! - timeout: a deadline that lands while a command is still loading no longer aborts the rest of the scripttimeouton a cold command — the first use of any lazily loaded command — could return 124 and still kill every statement after it. Cancelled invocations now stop waiting for the load and report cancellation instead.