summaryrefslogtreecommitdiff
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
commitfca87a8d865029b5f13114374e860ccbf31e5e7c (patch)
tree764970207a734c4fa418059d17a40746dd0a0332
parent431beeea82cc043c85b0137ade2b1b35534c3035 (diff)
downloaddotfiles-fca87a8d865029b5f13114374e860ccbf31e5e7c.tar
dotfiles-fca87a8d865029b5f13114374e860ccbf31e5e7c.tar.zst
dotfiles-fca87a8d865029b5f13114374e860ccbf31e5e7c.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.
-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
+}