Skip to content

v0.2.0

Choose a tag to compare

@jhheider jhheider released this 18 Jul 00:18
33c02b2

Second release. The core is unchanged; everything new is opt-in.

Switches - settable as a flag OR in the # /// scriptbox frontmatter (flag wins):

  • --argv0 <rewrite|source|off> - how $0 is set. New source mode dot-sources
    the script so $0 is the real path on every POSIX shell (dash/ksh included),
    at the cost of sourced-mode semantics.
  • --subscripts <report|wrap|freeze-tree> - analyze/rewrite a script's child
    invocations so the whole tree is frozen, not just the top file:
    • wrap routes shell children (bash child.sh, ./x.sh) through scriptbox and
      freezes resolvable source ./lib.sh includes into an inherited immutable fd
      (a real fix - zsh's source streams).
    • freeze-tree adds a launch-scoped, read-only, pin-on-copy snapshot cache so
      every invocation of a script in the tree sees the same bytes even against
      mid-run edits, plus a depth cap against runaway recursion.
      The analyzer is included in these prebuilt binaries. scriptbox gc reaps the
      freeze-tree caches.

Checksum pinning now excludes the whole frontmatter block, so switches are
frontmatter-flippable without re-pinning.

POSIX only (macOS + Linux). See the README.

Install

brew install jhheider/tap/scriptbox
curl -fsSL https://heider.cc/scriptbox.sh | sh