summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-06-25 08:01:48 +0200
committerxengineering <me@xengineering.eu>2024-06-26 20:31:19 +0200
commit413f15d2bdcdecc7945483ad2dc018019b4452d4 (patch)
treee8d932d100068a6bf5d70e796f1efbbe9fd6521b
parentfd102ebcdbcf078c7bc9ca259c814589b3b54882 (diff)
downloaddotfiles-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--.bashrc27
1 files changed, 14 insertions, 13 deletions
diff --git a/.bashrc b/.bashrc
index cb25238..0bfc279 100644
--- a/.bashrc
+++ b/.bashrc
@@ -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)/'
}