Tweak upgrade script to search for remote origin branches

This commit is contained in:
wiz 2021-12-09 18:12:06 +09:00
parent 053fb4d1b2
commit 9e8ee4fedc
No known key found for this signature in database
GPG Key ID: A394E332255A6173

View File

@ -21,13 +21,15 @@ update_repo()
cd "$HOME/${site}" || exit 1
git fetch origin || exit 1
for remote in mempool MiguelMedeiros knorrium;do
for remote in origin knorrium hunicus;do
git remote add "${remote}" "https://github.com/${remote}/mempool" >/dev/null 2>&1
git fetch "${remote}" || exit 1
done
if [ $(git tag -l "${REF}") ];then
git reset --hard "tags/${REF}" || exit 1
elif [ $(git branch -r -l "origin/${REF}") ];then
git reset --hard "origin/${REF}" || exit 1
else
git reset --hard "${REF}" || exit 1
fi