diff options
author | xengineering <me@xengineering.eu> | 2024-06-25 08:01:48 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-06-26 20:31:19 +0200 |
commit | 413f15d2bdcdecc7945483ad2dc018019b4452d4 (patch) | |
tree | e8d932d100068a6bf5d70e796f1efbbe9fd6521b | |
parent | fd102ebcdbcf078c7bc9ca259c814589b3b54882 (diff) | |
download | dotfiles-413f15d2bdcdecc7945483ad2dc018019b4452d4.tar dotfiles-413f15d2bdcdecc7945483ad2dc018019b4452d4.tar.zst dotfiles-413f15d2bdcdecc7945483ad2dc018019b4452d4.zip |
bash: Fix program check before PATH extension
It makes more sense to check for missing programs after the PATH is
customized since some of the programs might be installed in unusual
locations.
-rw-r--r-- | .bashrc | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -30,19 +30,6 @@ swaylock vdirsyncer ' -# check for missing programs -echo "$PROGRAMS" | while read -r program -do - if [ "$program" == '' ] - then - continue - fi - if ! command -v "$program" > /dev/null 2>&1 - then - echo "Program is missing: '$program'" - fi -done - # alias definitions alias ls='ls --color=auto' alias ll='ls -alF' @@ -79,6 +66,20 @@ alias zephyr='export ZEPHYR_BASE="${HOME}/zephyrproject/zephyr" && source "${HOM PATH=~/.local/bin:$PATH +# check for missing programs +echo "$PROGRAMS" | while read -r program +do + if [ "$program" == '' ] + then + continue + fi + if ! command -v "$program" > /dev/null 2>&1 + then + echo "Program is missing: '$program'" + fi +done + + parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } |