diff --git a/update.sh b/update.sh index 2436823..7f50a75 100755 --- a/update.sh +++ b/update.sh @@ -14,7 +14,10 @@ check_dependency() { fi } -! groups | grep -E 'root|wheel|sudo' >/dev/null && echo "You need administrative privileges for this script" && exit 1 +if ! groups | grep -E 'root|wheel|sudo' >/dev/null; then + echo "You need administrative privileges for this script" >&2 + exit 1 +fi check_dependency curl check_dependency go @@ -22,14 +25,14 @@ check_dependency jq check_dependency tar check_dependency xargs -echo -e '\nDownloading cpolis...' +echo -e '\nDownloading cpolis...' >&2 rm -fr $CPOLIS_DIR/* latest_release=$(curl -s $CPOLIS_REPO_URL | jq -r '.[0].tag_name') curl -Lo $TMP_DIR/cpolis.tar.gz https://git.streifling.com/jason/cpolis/archive/$latest_release.tar.gz tar -xzf $TMP_DIR/cpolis.tar.gz -C $EXTRACTION_DIR rm $TMP_DIR/cpolis.tar.gz -echo -e '\nDownloading TailwindCSS...' +echo -e '\nDownloading TailwindCSS...' >&2 curl -s $TAILWINDCSS_REPO_URL | grep -F browser_download_url | grep -F linux-x64 | @@ -40,7 +43,7 @@ $CPOLIS_DIR/tailwindcss -i web/static/css/input.css -o web/static/css/style.css go build -o $TMP_DIR/cpolis $CPOLIS_DIR/cmd/main.go -echo -e 'Setting system files up' +echo -e 'Setting system files up' >&2 sudo mv $TMP_DIR/cpolis $BIN_DIR/cpolis sudo chown root:root $BIN_DIR/cpolis chmod +x $BIN_DIR/cpolis