This commit is contained in:
siritami
2023-06-19 13:41:48 +07:00
parent 80422d0339
commit d25b64585f
4 changed files with 30 additions and 51 deletions

View File

@@ -2,6 +2,24 @@
#################################################
checker() {
curl -sL https://api.github.com/repos/$1/releases/latest > json.txt
latest_version=$(jq -r '.name' json.txt)
echo $latest_version > latest-version.txt
curl -sL "https://api.github.com/repos/$repository/releases/latest" | jq -r '.assets[] | select(.name == "'$2'-version.txt") | .browser_download_url' | xargs curl -sLO
cur_version=$(cat $2-version.txt)
if [ "$latest_version" = "$cur_version" ]; then
echo "Old patch, not build!"
exit 0
else
echo "New patch, building..."
rm -f ./$2-version.txt ./json.txt
mv latest-version.txt $2-version.txt
fi
}
#################################################
# Download Github assets requirement:
dl_gh() {
for repo in $1 ; do