Update SaveExternal

This commit is contained in:
LukeeGD 2020-08-04 23:49:55 +08:00 committed by GitHub
parent 4a0b20351c
commit b76e22bb12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -491,16 +491,18 @@ function SaveExternal {
[[ $1 == "iOS-OTA-Downgrader-Keys" ]] && External="firmware"
if [[ ! -d resources/$External ]] || [[ ! -d resources/$External/.git ]]; then
Log "Downloading $External..."
cd tmp
git clone $ExternalURL $External &>/dev/null
rm -rf ../resources/$External
cp -r $External/ ../resources/
cd resources
rm -rf $External
git clone $ExternalURL $External
else
Log "Updating $External..."
cd resources/$External
git pull &>/dev/null
git pull 2>/dev/null
cd ..
fi
if [[ ! -e $External/README.md ]] || [[ ! -d $External/.git ]]; then
Error "Downloading/updating $1 failed. Please run the script again"
fi
cd ..
}