summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-06-27 21:47:21 +0200
committerxengineering <me@xengineering.eu>2024-06-27 21:47:21 +0200
commita4a4db8358c3c890309f1f56a22ba3dd55b99f81 (patch)
tree60388cbc3922e3254b412e0bd6692c525922c47a
parent14789fded45a679167dbb0b0978550dd234f313e (diff)
downloaddotfiles-a4a4db8358c3c890309f1f56a22ba3dd55b99f81.tar
dotfiles-a4a4db8358c3c890309f1f56a22ba3dd55b99f81.tar.zst
dotfiles-a4a4db8358c3c890309f1f56a22ba3dd55b99f81.zip
posix-shell: Update check_programs()
- sort list of programs automatically - report all programs with a check mark `[x]` or without `[ ]`
-rw-r--r--posix-shell/programs.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/posix-shell/programs.sh b/posix-shell/programs.sh
index 085d878..1a719a3 100644
--- a/posix-shell/programs.sh
+++ b/posix-shell/programs.sh
@@ -25,15 +25,19 @@ vdirsyncer
check_programs() {
- echo "$PROGRAMS" | while read -r program
+ echo "$PROGRAMS" | sort | while read -r program
do
if [ "$program" = '' ]
then
continue
fi
- if ! command -v "$program" > /dev/null 2>&1
+ local state=''
+ if command -v "$program" > /dev/null 2>&1
then
- echo "Program is missing: '$program'"
+ state='x'
+ else
+ state=' '
fi
+ echo "[${state}] $program"
done
}