useful-scripts/conf/profile

26 lines
694 B
Text
Raw Normal View History

2025-10-29 16:55:38 +00:00
#!/bin/sh
_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