1
0
mirror of https://github.com/bplein/factorio-docker.git synced 2025-01-10 03:16:41 +02:00

Mod Updater: Force remove mod archives

Closes #293
This commit is contained in:
Sandro Jäckel 2019-11-04 16:12:24 +01:00
parent 1b7decd8ce
commit efcc29cfed
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -58,7 +58,7 @@ update_mod()
if [[ $HTTP_STATUS != 200 ]]; then
print_failure " Download failed: Code $HTTP_STATUS."
rm "$MOD_DIR/$MOD_FILENAME"
rm -f "$MOD_DIR/$MOD_FILENAME"
return 1
fi
@ -69,7 +69,7 @@ update_mod()
if ! [[ $(sha1sum "$MOD_DIR/$MOD_FILENAME") =~ $MOD_SHA1 ]]; then
print_failure " SHA1 mismatch!"
rm "$MOD_DIR/$MOD_FILENAME"
rm -f "$MOD_DIR/$MOD_FILENAME"
return 1
fi
@ -78,7 +78,7 @@ update_mod()
for file in "$MOD_DIR/${MOD_NAME}_"*".zip"; do # wildcard does usually not work in quotes: https://unix.stackexchange.com/a/67761
if [[ $file != $MOD_DIR/$MOD_FILENAME ]]; then
print_success " Deleting old version: $file"
rm "$file"
rm -f "$file"
fi
done