From a4a4db8358c3c890309f1f56a22ba3dd55b99f81 Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 27 Jun 2024 21:47:21 +0200 Subject: posix-shell: Update check_programs() - sort list of programs automatically - report all programs with a check mark `[x]` or without `[ ]` --- posix-shell/programs.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'posix-shell/programs.sh') 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 } -- cgit v1.2.3-70-g09d2