Compare commits

...

2 Commits

Author SHA1 Message Date
deaaf83967 Do not stop updating process on incompatible version
Closes #308
2020-04-05 11:09:01 +02:00
9691472b84 Backport #307 to 0.17 2020-04-05 11:07:18 +02:00
2 changed files with 7 additions and 6 deletions

View File

@ -32,19 +32,20 @@ update_mod()
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME" MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME"
MOD_INFO_JSON=$(curl --silent "$MOD_INFO_URL") MOD_INFO_JSON=$(curl --silent "$MOD_INFO_URL")
if ! echo "$MOD_INFO_JSON" | jq -e .name >/dev/null; then
print_success " Custom mod not on $MOD_BASE_URL, skipped."
return 0
fi
MOD_INFO=$(echo "$MOD_INFO_JSON" | jq -j --arg version "$FACTORIO_VERSION" ".releases|reverse|map(select(.info_json.factorio_version as \$mod_version | \$version | startswith(\$mod_version)))[0]|.file_name, \";\", .download_url, \";\", .sha1") MOD_INFO=$(echo "$MOD_INFO_JSON" | jq -j --arg version "$FACTORIO_VERSION" ".releases|reverse|map(select(.info_json.factorio_version as \$mod_version | \$version | startswith(\$mod_version)))[0]|.file_name, \";\", .download_url, \";\", .sha1")
MOD_FILENAME=$(echo "$MOD_INFO" | cut -f1 -d";") MOD_FILENAME=$(echo "$MOD_INFO" | cut -f1 -d";")
MOD_URL=$(echo "$MOD_INFO" | cut -f2 -d";") MOD_URL=$(echo "$MOD_INFO" | cut -f2 -d";")
MOD_SHA1=$(echo "$MOD_INFO" | cut -f3 -d";") MOD_SHA1=$(echo "$MOD_INFO" | cut -f3 -d";")
if [[ -z $MOD_URL ]]; then
return 1
fi
if [[ $MOD_FILENAME == null ]]; then if [[ $MOD_FILENAME == null ]]; then
print_failure " Not compatible with version" print_failure " Not compatible with version"
return 1 return 0
fi fi
if [[ -f $MOD_DIR/$MOD_FILENAME ]]; then if [[ -f $MOD_DIR/$MOD_FILENAME ]]; then

View File

@ -45,7 +45,7 @@ update_mod()
if [[ $MOD_FILENAME == null ]]; then if [[ $MOD_FILENAME == null ]]; then
print_failure " Not compatible with version" print_failure " Not compatible with version"
return 1 return 0
fi fi
if [[ -f $MOD_DIR/$MOD_FILENAME ]]; then if [[ -f $MOD_DIR/$MOD_FILENAME ]]; then