Updated update script
This commit is contained in:
parent
6fb995aa30
commit
bdc824c357
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
# The following packages are needed to function: curl, jq
|
# The following packages are needed to function: curl, jq
|
||||||
source PKGBUILD
|
source PKGBUILD
|
||||||
@ -7,7 +8,11 @@ api_data="$(curl -sH "Accept: application/vnd.github.v3+json" "https://api.githu
|
|||||||
|
|
||||||
latest_version="$( echo "${api_data}" | jq -r '.tag_name' | rev | head -c -2 | rev)"
|
latest_version="$( echo "${api_data}" | jq -r '.tag_name' | rev | head -c -2 | rev)"
|
||||||
|
|
||||||
if [[ "${pkgver}" != "${latest_version}" ]]; then
|
if [[ "${pkgver}" == "${latest_version}" ]]; then
|
||||||
|
echo "Package is up to date."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Updating PKGBUILD info..."
|
echo "Updating PKGBUILD info..."
|
||||||
|
|
||||||
number=1
|
number=1
|
||||||
@ -27,6 +32,6 @@ if [[ "${pkgver}" != "${latest_version}" ]]; then
|
|||||||
|
|
||||||
sed -i "s|pkgver=.*|pkgver='${latest_version}'|" PKGBUILD
|
sed -i "s|pkgver=.*|pkgver='${latest_version}'|" PKGBUILD
|
||||||
sed -i "s|sha256sums_x86_64=.*|sha256sums_x86_64=('${checksum_value}')|" PKGBUILD
|
sed -i "s|sha256sums_x86_64=.*|sha256sums_x86_64=('${checksum_value}')|" PKGBUILD
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user