From 413f15d2bdcdecc7945483ad2dc018019b4452d4 Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 25 Jun 2024 08:01:48 +0200 Subject: 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. --- .bashrc | 27 ++++++++++++++------------- 1 file 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)/' } -- cgit v1.2.3-70-g09d2