summaryrefslogtreecommitdiff
path: root/posix-shell/programs.sh
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-06-27 21:12:51 +0200
committerxengineering <me@xengineering.eu>2024-06-27 21:12:51 +0200
commit8d86e9c0d05c3bb7cbff33d5cf179a402ce98225 (patch)
tree764970207a734c4fa418059d17a40746dd0a0332 /posix-shell/programs.sh
parent744256c36071e4cbd407dbdca20529e6350a6207 (diff)
downloaddotfiles-8d86e9c0d05c3bb7cbff33d5cf179a402ce98225.tar
dotfiles-8d86e9c0d05c3bb7cbff33d5cf179a402ce98225.tar.zst
dotfiles-8d86e9c0d05c3bb7cbff33d5cf179a402ce98225.zip
posix-shell: Do not check programs on shell init
The functionality is now available as `check_programs()`. Not executing it on shell startup makes it more comfortable to use systems which do not provide all the mentioned programs.
Diffstat (limited to 'posix-shell/programs.sh')
-rw-r--r--posix-shell/programs.sh25
1 files changed, 13 insertions, 12 deletions
diff --git a/posix-shell/programs.sh b/posix-shell/programs.sh
index 06af8e9..085d878 100644
--- a/posix-shell/programs.sh
+++ b/posix-shell/programs.sh
@@ -24,15 +24,16 @@ 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
+check_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
+}