Skip to content

Commit 487dd22

Browse files
committed
fixing mod encoding
1 parent d19bdfa commit 487dd22

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## Changelog
22

3+
### V2.2.1
4+
5+
#### Non-Breaking Changes
6+
7+
- Fixing mod download script to encode spaces properly, fixes [Issue 42](https://github.com/SQLJames/factorio-server-charts/issues/42)
8+
39
### V2.2.0
410

511
#### Non-Breaking Changes

charts/factorio-server-charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sources:
2020
# This is the chart version. This version number should be incremented each time you make changes
2121
# to the chart and its templates, including the app version.
2222
# Versions are expected to follow Semantic Versioning (https://semver.org/)
23-
version: 2.2.0
23+
version: 2.2.1
2424

2525
# This is the version number of the application being deployed. This version number should be
2626
# incremented each time you make changes to the application. Versions are not expected to

charts/factorio-server-charts/templates/deployment.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,14 @@ spec:
8585
imagePullPolicy: {{ .Values.image.pullPolicy }}
8686
command:
8787
- /bin/bash
88-
- -ec
88+
- -ecx
8989
- |
9090
mkdir -p /factorio/mods
91+
ls -alth /scripts
92+
echo "Running mod-downloader.sh script..."
9193
bash /scripts/mod-downloader.sh
94+
echo "Finished mod-downloader.sh script"
95+
ls -althR /factorio/mods
9296
{{- with .Values.securityContext }}
9397
securityContext:
9498
{{- toYaml . | nindent 12 }}

charts/factorio-server-charts/templates/mod-downloader-configmap.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ data:
3939
cd $modDir;curl -L -o $2 $1
4040
}
4141
function downloadofficial() {
42+
MOD_NAME="$1"
43+
MOD_NAME_ENCODED="${1// /%20}"
4244
if [[ -z ${USERNAME:-} ]]; then
4345
USERNAME="$(cat /account/username)"
4446
fi
@@ -54,7 +56,7 @@ data:
5456
if [[ -z ${TOKEN:-} ]]; then
5557
echo "You need to provide your Factorio token to update mods."
5658
fi
57-
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$1"
59+
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME_ENCODED"
5860
MOD_INFO_JSON=$(curl --silent "$MOD_INFO_URL")
5961
# echo "$MOD_INFO_URL $MOD_INFO_JSON"
6062
if ! echo "$MOD_INFO_JSON" | jq -e .name >/dev/null; then

0 commit comments

Comments
 (0)