Skip to content

Commit

Permalink
Fix bug where you could try to launch the game without having any gam…
Browse files Browse the repository at this point in the history
…e files downloaded due to `SKIPUPDATE=true`

General cleanup
  • Loading branch information
wolveix committed Dec 13, 2023
1 parent 53e62f2 commit bc5c0cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
10 changes: 0 additions & 10 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
# These are supported funding model platforms

github: [wolveix]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://paypal.me/wolveix
14 changes: 9 additions & 5 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,19 @@ if [ -n "$SERVERIP" ]; then
SERVERIP="-multihome=\"$SERVERIP\""
fi

# should we add an check, that if it is first installation to download the files?
if ! [[ "${SKIPUPDATE,,}" == "true" ]]; then
if [[ "${SKIPUPDATE,,}" != "true" ]] && [ ! -f "/config/gamefiles/FactoryServer.sh" ]; then
printf "%s Skip update is set, but no game files exist. Updating anyway\\n" "${MSGWARNING}"
SKIPUPDATE="false"
fi

if [[ "${SKIPUPDATE,,}" != "true" ]]; then
if [[ "${STEAMBETA,,}" == "true" ]]; then
printf "Experimental flag is set. Experimental will be downloaded instead of Early Access.\\n"
STEAMBETAFLAG="experimental"
else
STEAMBETAFLAG="public"
fi
# returns for Kubernetes 0 but works, probably for wrong folder the check is done?

STORAGEAVAILABLE=$(stat -f -c "%a*%S" .)
STORAGEAVAILABLE=$((STORAGEAVAILABLE/1024/1024/1024))
printf "Checking available storage...%sGB detected\\n" "$STORAGEAVAILABLE"
Expand All @@ -142,7 +146,7 @@ else
printf "Skipping update as flag is set\\n"
fi

# temporary migration to new format
# START temporary migration to new format
if [ -d "/config/blueprints" ]; then
if [ -n "$(ls -A "/config/blueprints" 2>/dev/null)" ]; then
rm -rf "/config/saved/blueprints"
Expand All @@ -163,7 +167,7 @@ fi
if [ -f "/config/ServerSettings.${SERVERQUERYPORT}" ]; then
mv "/config/ServerSettings.${SERVERQUERYPORT}" "/config/saved/ServerSettings.${SERVERQUERYPORT}"
fi
# temporary migration to new format
# END temporary migration to new format

cp -r "/config/saved/server/." "/config/backups/"
cp -r "${GAMESAVESDIR}/server/." "/config/backups" # useful after the first run
Expand Down

0 comments on commit bc5c0cf

Please sign in to comment.