mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2024-12-25 18:38:22 +01:00
Truly fix mod updates with spaces in names (#320)
This commit is contained in:
parent
1ef555ab24
commit
bc3b08e470
@ -25,11 +25,12 @@ print_failure()
|
|||||||
|
|
||||||
update_mod()
|
update_mod()
|
||||||
{
|
{
|
||||||
MOD_NAME="${1// /%20}"
|
MOD_NAME="$1"
|
||||||
|
MOD_NAME_ENCODED="${1// /%20}"
|
||||||
|
|
||||||
print_step "Checking for update of mod $MOD_NAME..."
|
print_step "Checking for update of mod $MOD_NAME..."
|
||||||
|
|
||||||
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME"
|
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME_ENCODED"
|
||||||
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
|
if ! echo "$MOD_INFO_JSON" | jq -e .name >/dev/null; then
|
||||||
|
@ -25,11 +25,12 @@ print_failure()
|
|||||||
|
|
||||||
update_mod()
|
update_mod()
|
||||||
{
|
{
|
||||||
MOD_NAME="${1// /%20}"
|
MOD_NAME="$1"
|
||||||
|
MOD_NAME_ENCODED="${1// /%20}"
|
||||||
|
|
||||||
print_step "Checking for update of mod $MOD_NAME..."
|
print_step "Checking for update of mod $MOD_NAME..."
|
||||||
|
|
||||||
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME"
|
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME_ENCODED"
|
||||||
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
|
if ! echo "$MOD_INFO_JSON" | jq -e .name >/dev/null; then
|
||||||
|
Loading…
Reference in New Issue
Block a user