Skip to content

Conversation

@balupton
Copy link
Member

@balupton balupton commented Feb 6, 2025

Closes:

May close:

Improves:

Discards old implementation of:

Changes:

  • ci:
    • split login shells, formatting, and linting into separate jobs
    • ensure jobs are executed in a way that prevent failure exit statuses from being discarded
    • add macos-26 testing
    • add bash version testing
    • drop alpine as no deno
    • add arch, almalinux, openmandriva, devuan, vanilla
  • shellcheck:
    • ignore more common lint false positives
  • trunk:
    • upgrade versions
    • disable linters that are not applicable
    • disable shellcheck sourcing, as it causes crashes
  • fixtures:
    • introduce fixtures for testing, located at bevry/dorothy-fixtures and cloned out to the git ignored $DOROTHY/fixtures on dorothy test
  • vscode:
    • show line numbers in markdown and plaintext
    • disable cspell, as it's handled by trunk
    • fix some associations
  • *:
    • write to >&* instead of /dev/* as the latter causes issues on linux systems, as redirections from say > /dev/stderr to &2>> stderr.log will cause overwrites on linux instead of appends
      • such redirections are now handled easily and automagically by the new __do, __to, __value_to_tty functions
    • use new bash.bash helpers
      • __lowercase_string is now __get_lowercase_string
      • $USER is now $CURRENT_USER or $LOGIN_USER as appropriate
      • command-(exists|missing) is now __command_(exists|missing), and there is a new __command_required for dependency requirements, and __tool for elective tool dependencies
      • date and date-helper is often now __get_date which is far more performant
      • echo-error is now __print_error
      • echo-join is now __join
      • eval_capture is now __try, however usually it is combined with logic that makes you want the new __do instead
      • eval-no-color can often be either <cmd> --no-color or COLOR=no <cmd>
      • get-flag-value is now __flag
      • is-(non-)affirmative is now __is_(non_)affirmative, however if you are using for parsing a flag, then use __flag --(non-)affirmative
      • is-ci is now [[ -n $CI ]]
      • is-integer is now __is_integer
      • is-needle is now __has
      • is-number is now __is_number
      • mapfile is now in most cases better replaced by __split
      • sudo-helper is now eval-helper --elevate, which resolves prior complexity and conflicts between the two
      • user, group, uid, and gid handling is now more robustly done by bash.bash helpers
    • use new styles.bash helpers
      • echo-style is now __print_style
      • cat ...<help> is now __print_help
    • use new is-* and fs-* helpers, which have permission awareness and automagically handle elevation by default
      • type -t <function> function checks can now be done by __affirm_function_is_defined <function>
    • stdinargs.bash, echo-*:
      • there is new __on_whole, __on_piece, __on_stdin, __on_nothing hooks for performance and accuracy
    • eval-tester:
      • now captures and tests TTY
    • eval-helper, echo-revolving-door:
      • more intelligent ANSI shapeshifting parsing, allowing for more robust and more powerful clearing
    • change <var>="$(printf ...)" to printf -v <var> ... where appropriate for performance gains
  • beta commands:
    • echo-escape-special:
      • now respects inlines
    • echo-eval:
      • rewrote completely
    • echo-if-(directory|executable), ensure-trailing-newline:
      • now uses the new is-* and fs-* helpers
    • edit:
      • --sudo is now --elevate, as per the new is-* and fs-* helpers
    • find-(directories|files|symlinks)|icloud-helper:
      • ensure find dependency
    • font-search:
      • fix bad grep option
    • get-codec, video-merge:
      • rewrote with dependency handling and robust outputs
    • is-empty-size:
      • ensure correct dependency
    • is-fedora:
      • fix fedora check
    • is-password-usable:
      • support passing a user, and specifying between the current user and login user
    • is-shapeshifter:
      • do not output the colon anymore
      • underlying implementation of ansi.bash:__is_shapeshifter has been dramatically improved, supporting more non-shapeshifting ANSI escape sequences
    • is-suffix:
      • fix underlying implementation for cross bash version compatibility
    • macos-theme:
      • simplified outputs
    • video-merge:
      • rewrote completely
    • ytd-helper:
      • rewrote completely
  • deprecations:
    • alias-helper is now fs-alias
    • cpr is now fs-copy
    • echo-checksum is now checksum
    • echo-clear-line is noe echo-style --no-trail --delete-line or __print_style --no-trail --delete-line
    • echo-mkdir is now fs-mkdir --verbose
    • echo-title is now echo-style --no-trail --tty --title=<title> or __print_style --no-trail --tty --title=<title>
    • echo-wait is now echo-write ...
    • fs-(absolute|basename|dirname|extension|filename|parents|realpath) is now fs-path ...
    • fs-(bytes|kilobytes|megabytes) is now fs-size ...
    • fs-ln|symlink-helper is now fs-link
    • fs-mv is now fs-move
    • fs-rm is now fs-remove
    • get-file is now fs-type
    • get-git-active-branch is now get-helper current-branch
    • get-git-default-branch is now get-helper default-branch
    • get-terminal-device-file can now be $TERMINAL_OUTPUT_TARGET in bash.bash
    • sudo-helper is now eval-helper --elevate
    • sudo-helper --local is now config-edit --local
    • until-success is now eval-helper --until=success
  • commands:
    • ask, choose, confirm:
      • inline echo-clear-lines for a tiny bit better performance
    • ask:
      • fixed various edge cases around defaults, bash versions, and TTY support
      • inline echo-clear-lines for a tiny bit better performance
    • brew:
      • rewrote to fix --help handling
    • brew-installed(.ts)?:
      • support tap detection
    • checksum:
      • rewrote, add tests, support strings, progress, tool selection, installation
    • choose:
      • fixed terminal margin calculations
      • fix cursor restorations
    • command-working:
      • add find, gsed, sed, ssh, and xargs to exceptions
      • detailed error reporting
    • config-edit:
      • add --[no-]local, which previously was inside the now deprecated sudo-helper
    • config-helper:
      • support automatic elevation
    • confirm:
      • redid styles to be fancier but more importantly, more obvious for what one actually has selected
    • date-helper:
      • add --(utc|8601|unix|adguard|ytd)
      • fix --month-ago for trailing days of a longer month than prior
    • debug-bash:
      • rewrote, and added support for --(ab|av|all|continue|wrap|code|debug|trace) and -(v|x|xv|vx)
    • debug-terminal:
      • new command to be authoritative about terminal capabilities across different contexts
    • dorothy:
      • now sources remote bash.bash rather than reimplementing imitation helpers
      • completely rewritten installation, dependency, and XDG handling, delegating to setup-shell, git-helper, and fs-move --symlink
      • can now test across multiple bash versions, thanks to new debug-bash capabilities
      • tests action now ensures new fixtures repo is cloned
    • dorothy-config:
      • fixes to config writing
    • dorothy-internals:
      • new command to comprehensively test all internal bash.bash and co capabilities
    • dorothy-warnings:
      • fixes
    • down:
      • use new eval-helper and echo-revolving-door capabilities for improved progress bar rendering
      • comprehensive support for various wget compatibility divergences
      • better detection and forwarding of archive properties
      • comprehensive support for tooling exit statuses
    • echo-clear-lines, echo-revolving-door, echo-trim-special, eval-helper, ansi.bash:
      • rewrote and co for new capabilities, such as specifying min/max lines, and properly parsing all known ANSI escape sequences, and supporting more shapeshifter sequences; enabling progress bar support within down, and enabling sliding windows for say extractions or utility installations that keep important headers visible while sliding a sub-window of ephemeral lines
    • echo-duration:
      • new command for outputting durations, as used by eval-tester and eval-helper --time
    • echo-escape-command:
      • new capabilities for use in making eval-helper wrapping nicer
    • echo-file:
      • rewrote
    • echo-inject:
      • new command for injecting content into files at specific locations
    • echo-json:
      • new command for parsing, encoding, decoding, stringifying, and making JSON
    • echo-math:
      • rewrote, and fixed various cross-compat edge cases, while improving performance
    • echo-max:
      • new command
    • echo-quote:
      • rewrote and fixed various edge cases
    • echo-substr:
      • inlined its sliding window approach, as the new bash.bash helpers work differently
    • echo-transpose:
      • new command for transposing data
    • echo-unique:
      • new command to handle divergences in sort and uniq implementations, which now uses bash.bash helpers
    • echo-uppercase:
      • new command
    • echo-verbose:
      • uses the new and more intelligent __print_style variable rendering and stdinargs hooks, such that empty results and variables have consistent styling
    • echo-wrap:
      • like many other echo-* commands, uses the new stdinargs to fix edge cases
    • echo-write:
      • rewritten version of echo-wait, to completely replace things like sponge and ifne and in some cases tee
    • edit:
      • fix dry mode handling
    • setup-mac-brew:
      • fix for tap API changes
      • prettier outputs thanks to new eval-helper and brew-installed(.ts)?

Follow-ups:

  • not all deprecated commands have their deprecation warnings it seems
  • move of echo-filenames to commands.deprecated may have been an accident, check the changelog
  • echo-mkdir has the wrong function name, from a bad copy paste

Todos:

Current batch todos, in any order:

  • merge my other WIP changes with the dev branch
  • new setup-shell flow
    • add login shell detection
    • make sure there is a cannot configure nu if nu not installed check
    • make sure that uninstallations in the setup-util-$shell flow remove uninstalled login shell, without endless recursion - I've added an exclude option, however need to finish implementing it
    • need to make sure that when unsetting a login shell, we use the next preference or prompt
    • need to implement the configuration saving
    • make use_shells empty by default, as otherwise everything is selected for login shell
  • auto-elevation
    • config-helper
    • echo-wait
    • echo-file
    • new is-touchable
    • --sudo flag to --elevate in all relevant locations
  • eval-helper and sudo-helper should be merged, or need a new eval-target command, to avoid conflating stderr output in no-tty mode (achieved by new __do function)
    • implement and test and cleanup new __do and __try functions
    • update Dorothy tests action for new semaphore location
  • echo-wait cleanup
  • get-installer to use a json file, so it can run on bash v3 which will fix dorothy-config failing on old bash versions.
  • sudo --stdin flag when needed
  • don't write theme fallback to cache
  • move styles.bash env vars preset to setup-environment-commands
  • test new get-terminal-theme on WSL
  • merge and release
  • figure out why the choose error happens if no git remote, as it should have thrown before calling choose - this could be the bash bug manifesting itself, or could be a bug in prior try versions now fixed
  • update outdated bash docs
  • experiment with custom tty device file when in no-tty so stderr is not filled up
  • complete cache expiry unification for get-terminal-theme and setup-environment-commands, for now live with the bug that is introduced where one must manually clear the terminal theme cache

the drop of `jq` in `get-installer` fixes `get-installer` calling `__command_required` which calls `get-installer` to install `jq` which causes infinite recursion /ref https://github.com/bevry/dorothy/actions/runs/19094345762/job/54550976744

turns out the `jq` dep was entirely unnecessary, as in the end jq was just converting it to a DSV anyway

this also adds sorting to `dorothy lint` of `installers.dat` and `cspell.json`

also does some linting fixes
use `command -v` on zsh, fix title separator handling, linting
@balupton balupton changed the title improve installation experience fix install, improve everything Nov 6, 2025
@balupton balupton merged commit 1a4ac9f into master Nov 6, 2025
14 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants