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" [[ $1 == "iOS-OTA-Downgrader-Keys" ]] && External="firmware"
if [[ ! -d resources/$External ]] || [[ ! -d resources/$External/.git ]]; then if [[ ! -d resources/$External ]] || [[ ! -d resources/$External/.git ]]; then
Log "Downloading $External..." Log "Downloading $External..."
cd tmp cd resources
git clone $ExternalURL $External &>/dev/null rm -rf $External
rm -rf ../resources/$External git clone $ExternalURL $External
cp -r $External/ ../resources/
else else
Log "Updating $External..." Log "Updating $External..."
cd resources/$External cd resources/$External
git pull &>/dev/null git pull 2>/dev/null
cd .. cd ..
fi fi
if [[ ! -e $External/README.md ]] || [[ ! -d $External/.git ]]; then
Error "Downloading/updating $1 failed. Please run the script again"
fi
cd .. cd ..
} }