_path_add only ever appended to PATH, which didn't fit profile.d/krew
and profile.d/anyenv (they prepend, to take priority). Rename it to
_path_append for clarity and add _path_prepend alongside it, so both
orderings get the same dedup guard when needed — krew and anyenv
aren't converted yet, kept as plain PATH concatenation until then.
The removed loop tried to source /etc/bash*completion and
/etc/profile.d/bash*completion* by hand, with two real problems:
nullglob wasn't enabled for it (unlike everywhere else via
_source_dir_files), so an empty match sourced the literal glob
pattern and errored — the TODO already flagged this. It also
re-sourced /etc/profile.d/bash_completion.sh, a script meant for
/etc/profile on login shells, not for being re-run from an
interactive-only ~/.bashrc.
On a properly packaged system, bash-completion wires itself up
already (confirmed here via /etc/profile.d/bash_completion.sh and
progcomp being on by default) — this loop was dead weight at best and
a source of environment-dependent breakage at worst (seen previously
on Termux, where /etc doesn't have the same layout).
profile.d/path and rc.d/rvm concatenated onto PATH directly, so
re-sourcing them in the same shell (source ~/.bashrc, a resourced
tmux pane, etc.) would duplicate entries. _path_add already guards
against that and tests directory existence itself.
profile.d/krew and profile.d/anyenv are left untouched: they prepend
to PATH (to take priority over other entries), while _path_add always
appends — converting them would silently change resolution order.
rc.d/asdf tested native (~/.asdf) and Nix-profile asdf independently,
so if both were present on a machine, asdf would be sourced twice —
duplicate PATH entries and redefined completions/functions. Make the
Nix branch an elif so at most one is sourced.
3rd-party/z (rupa/z) was declared but the directory doesn't exist on
disk, isn't in the git index, and nothing sources it — zoxide replaced
it as the cd-frecency tool (see rc.d/zoxide). complete-alias and
fzf-git.sh are left as-is; they still need to be initialized via the
chezmoi-managed external config that clones this repo (separate task).
These files stay deprecated and out of the sourcing path for now, but
apply the same ${var} notation cleanup as the rest of the repo where
it's a pure notation fix. basedir.bash is left untouched: its bug is
a broken escape, not a notation issue, and it mirrors the one already
removed from _helpers.bash.
basedir() had a broken escape ($(dirname \"$-2\") makes no sense) and
was never called anywhere in the repo — it's a leftover copy of the
already-deprecated libs.deprecated/basedir.bash. bashrc already has
its own get_script_dir() for the same need, with proper symlink
resolution.
rc.d/anyenv, rc.d/screen, aliases.d/mc, and rc.d/startx were the last
holdouts still using `which` to check tool availability. Every other
file in rc.d/* already uses `command -v`, which doesn't depend on an
external binary being installed.
Replace bare $var with ${var} everywhere it was still used, matching
the convention already established in rc.d/prompt and rc.d/history.
Positional parameters ($1, $@, $#) and special variables ($?, $$, $-)
are left as-is, consistent with existing usage in _helpers.bash.
rc.d/broot is auto-generated by the broot binary and will likely be
overwritten with its original formatting on the next broot update.
These files are always sourced (never executed directly), so the
#!/bin/bash shebang is inert and misleading. Drop it consistently
across rc.d/*, profile.d/*, and aliases.d/*.
Merge rc.d/mcfly and rc.d/atuin into rc.d/history, following the same
preference-list + availability-check + fallback pattern as rc.d/prompt,
so only one history tool is active at a time instead of both being
initialized independently. Also normalize variable expansions in
rc.d/prompt to consistently use ${var} braces.
Without this, mise is not yet activated when evaluating the prefered
apps scripts and mise installed apps are considered not installed (for
exemple nvim for the EDITOR variable)
Before this:
The bash config repo needed to be cloned in ~/.bash/ to work properly
After this:
The bash config repo can be move anywhere (for exemple in
~/.config/bash).
The create-links.bash helper is adapted to this new behaviour.
So you can clone anywhere and call create-links.bash from anywhere. Then
the symbolic links in your home should be good and the config would load
correctly.