2025-10-29 16:55:38 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2025-10-30 13:58:34 +00:00
|
|
|
# if running bash
|
|
|
|
|
if [ -n "$BASH_VERSION" ]; then
|
|
|
|
|
# include .bashrc if it exists
|
|
|
|
|
if [ -f "$HOME/.bashrc" ]; then
|
|
|
|
|
. "$HOME/.bashrc"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2025-10-29 16:55:38 +00:00
|
|
|
_include_bindir_in_path() {
|
|
|
|
|
if [ -d "${1}" ]; then
|
|
|
|
|
real_bin_dir="$(readlink -f "${1}" )"
|
|
|
|
|
export PATH="${real_bin_dir}:${PATH}"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# include ~/bin and ~/bin.d/* in PATH
|
|
|
|
|
for bin_candidate in "${HOME}/bin/" "${HOME}/bin.d/"*; do
|
|
|
|
|
_include_bindir_in_path "${bin_candidate}"
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# ... also include a few well-known bin directories
|
|
|
|
|
for bin_location in ".local" ".poetry" ".cargo"; do
|
|
|
|
|
_include_bindir_in_path "${HOME}/${bin_location}/bin/"
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# ... include ALL OF THE ~/.whatever/bin directories (possibly unsafe)
|
|
|
|
|
# for bin_candidate in "${HOME}/."*"/bin/"; do
|
|
|
|
|
# _include_bindir_in_path "${bin_candidate}"
|
|
|
|
|
# done
|
|
|
|
|
|
|
|
|
|
unset -f _include_bindir_in_path
|