From b1a6359473a2c4ca585310c66685e03061106402 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sun, 18 Aug 2024 13:53:37 +0200 Subject: [PATCH] Exit update script if any requirement is not met --- update.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/update.sh b/update.sh index b81e314..07a1c34 100755 --- a/update.sh +++ b/update.sh @@ -5,11 +5,11 @@ CPOLIS_PATH=$HOME/cpolis TAILWINDCSS_REPO_URL=https://api.github.com/repos/tailwindlabs/tailwindcss/releases/latest SYSTEMD_USER_DIR=$HOME/.config/systemd/user -! which curl >/dev/null && echo "curl needs to be installed" -! which go >/dev/null && echo "go needs to be installed" -! which jq >/dev/null && echo "jq needs to be installed" -! which tar >/dev/null && echo "tar needs to be installed" -! which xargs >/dev/null && echo "xargs needs to be installed" +! which curl >/dev/null && echo "curl needs to be installed" && exit 1 +! which go >/dev/null && echo "go needs to be installed" && exit 1 +! which jq >/dev/null && echo "jq needs to be installed" && exit 1 +! which tar >/dev/null && echo "tar needs to be installed" && exit 1 +! which xargs >/dev/null && echo "xargs needs to be installed" && exit 1 latest_release=$(curl -s $CPOLIS_REPO_URL | jq -r '.[0].tag_name') curl -Lo cpolis.tar.gz https://git.streifling.com/jason/cpolis/archive/$latest_release.tar.gz