From 58dd61af65f35b3b8819523d55a1bc273ed20d1f Mon Sep 17 00:00:00 2001 From: Luna Komorebi Date: Fri, 2 Jun 2023 11:58:14 +0200 Subject: [PATCH] Check for required commands before installation --- install.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install.zsh b/install.zsh index a825bff..1caad86 100755 --- a/install.zsh +++ b/install.zsh @@ -1,6 +1,13 @@ #!/usr/bin/env zsh # env, because some OSes keep zsh in /bin (I'm looking at you, Alpine) +for cmd in curl git sed install find; do + if ! command -v $cmd >/dev/null; then + echo "[!] $cmd not found" + exit 1 + fi +done + install() { # screw you coreutils install and your ugly messages command install -Dv $@ | grep -v removed @@ -59,5 +66,6 @@ find bin -type f | while read -r file; do install $file $(echo $file | sed "s|bin|$HOME/.local/bin|") done +unfunction install -source $HOME/.zshrc +exec zsh