diff options
| author | xengineering <me@xengineering.eu> | 2024-06-27 21:47:21 +0200 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2024-06-27 21:47:21 +0200 |
| commit | f97942ade6ff8dd4953eff299f0531b4d80557ae (patch) | |
| tree | 60388cbc3922e3254b412e0bd6692c525922c47a | |
| parent | a4b889e4b9ac353522b03b018a611238a65f105e (diff) | |
| download | dotfiles-f97942ade6ff8dd4953eff299f0531b4d80557ae.tar dotfiles-f97942ade6ff8dd4953eff299f0531b4d80557ae.tar.zst dotfiles-f97942ade6ff8dd4953eff299f0531b4d80557ae.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.sh | 10 |
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 } |
