Skip to content

Use /data/tmp for WORLD zip preparation #3322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 4, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions scripts/start-setupWorld
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,25 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );

if isURL "$WORLD"; then
log "Downloading world from $WORLD"
if ! get -o /tmp/world.bin "$WORLD"; then
mkdir -p /data/tmp
if ! get -o /data/tmp/world.bin "$WORLD"; then
logError "Failed to download world from $WORLD"
exit 1
fi
WORLD=/tmp/world.bin
WORLD=/data/tmp/world.bin
fi

if [ -f "$WORLD" ]; then
log "Extracting world"

# Stage contents so that the correct subdirectory can be picked off
mkdir -p /tmp/world-data
if ! extract "$WORLD" /tmp/world-data; then
mkdir -p /data/tmp/world-data
if ! extract "$WORLD" /data/tmp/world-data; then
logError "Extracting world from $WORLD"
exit 1
fi

baseDirs=$(find /tmp/world-data -name "level.dat" -exec dirname "{}" \;)
baseDirs=$(find /data/tmp/world-data -name "level.dat" -exec dirname "{}" \;)

if ! [[ $baseDirs ]]; then
logError "World content is not valid since level.dat could not be found"
Expand Down
Loading