Make update script fail if pipeline fails; Also added update checks

This commit is contained in:
Hunter Wittenborn 2021-06-30 23:17:46 -05:00
parent bdc824c357
commit ed7beebd44

View File

@ -1,7 +1,18 @@
#!/usr/bin/env bash
set -e
set -o pipefail
for i in curl jq; do
if [[ "$(command -v "${i}")" == "" ]]; then
echo "${i} doesn't appear to be installed."
missing_pkg="true"
fi
done
if [[ "${missing_pkg}" == "true" ]]; then
exit 1
fi
# The following packages are needed to function: curl, jq
source PKGBUILD
api_data="$(curl -sH "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/drone/drone-cli/releases/latest")"