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
commit452c67a6829ef96c268a5be465b03f63c4e45c84 (patch)
treee8d932d100068a6bf5d70e796f1efbbe9fd6521b
parentbb57d91e57988fccea7d22561704de864e77d46e (diff)
downloaddotfiles-452c67a6829ef96c268a5be465b03f63c4e45c84.tar
dotfiles-452c67a6829ef96c268a5be465b03f63c4e45c84.tar.zst
dotfiles-452c67a6829ef96c268a5be465b03f63c4e45c84.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)/'
}