Skip to content

v0.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 22 Mar 18:55
· 1 commit to main since this release

What's new

  • macOS 15 & 16 support — sys::macos_code_name now recognises Sequoia and Tahoe
  • Portable architecture detection — sys::get_arch uses uname -m instead of Debian-only dpkg
  • Unknown flag warnings — ansi::style now warns on stderr instead of silently ignoring bad flags
  • Colour value validation — ansi::style validates --color=N and --rgb=R,G,B inputs

Bug fixes

  • user::group_exists — removed stray getent call that broke macOS support
  • fs::is_in_remote_mount — fixed broken regex ([cifs|nfs] → (cifs|nfs)) and escaped literal paths in grep
  • env::dotenv_delete — replaced sed -i with portable grep -v + mv pattern (fixes macOS)
  • sys::run_as — shell-escape arguments with printf %q to preserve boundaries in su -c; use id -un instead of $USER
  • fmt::bytes — handle zero (returns "0 B") and negative values (returns error); fix awk code injection via -v variable passing
  • text::filter_inside_markers — preserve leading whitespace (IFS= read)
  • text::apply_in_place — clean up temp file on filter failure
  • user::is_in_group — replace groups with id -nG and grep \b with grep -qxF for cross-platform support
  • pve::is_lxc — handle NUL-delimited /proc/1/environ correctly with tr
  • sys::is_in_path — use grep -qxF for literal matching (dots no longer match any character)
  • code::is_sourced — compare with realpath so symlinks work correctly
  • func::list_functions_in_file — fix wrong function name in error message

Security hardening

  • env::dotenv_load — replaced blind source with a line-by-line parser that validates assignment patterns before eval, rejecting arbitrary commands
  • env::dotenv_save — quote values with printf %q to preserve special characters
  • Variable name validation — dotenv_delete, dotenv_save, and ensure_is_set now reject invalid names, preventing regex injection
  • Literal marker matching — all text.sh marker functions use exact string comparison instead of regex, preventing metacharacter injection
  • Nameref collision prevention — prefixed internal locals with __jdvlib_ in args::get_flag_value and all env.sh functions

Platform guards

  • user::add_to_groups and user::create now fail explicitly on macOS via sys::ensure_linux
  • fs::is_in_remote_mount gated to Linux (uses mountpoint which is Linux-only)
  • meta::for_each_library_module returns an error in compiled mode

Infrastructure

  • Double-source guard — meta::import tracks imported modules to prevent infinite recursion from circular imports
  • Deleted deprecated text::replace_between_markers_legacy (hardcoded tmpfile bug)
  • Added bc to Docker test image
  • Parallel test execution support

Full Changelog: v0.1.0...v0.2.0