Skip to content

Commit

Permalink
Added 'FORCE_WORLD_COPY' environment variable (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
Trikolon authored Jul 10, 2020
1 parent cf69149 commit 092b530
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,9 @@ read-only volume attachment to ensure the clone source remains pristine.
docker run ... -v $HOME/worlds:/worlds:ro -e WORLD=/worlds/basic
```
### Overwrite world on start
The world will only be downloaded or copied if it doesn't exist already. Set `FORCE_WORLD_COPY=TRUE` to force overwrite the world on every server start.
### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
Like the `WORLD` option above, you can specify the URL of a "mod pack"
Expand Down
6 changes: 3 additions & 3 deletions start-finalSetupWorld
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else
worldDest=/data/$LEVEL
fi

if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
if [[ "$WORLD" ]] && isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ]; then
if isURL $WORLD; then
curl -fsSL "$WORLD" -o /tmp/world.zip
zipSrc=/tmp/world.zip
Expand All @@ -37,10 +37,10 @@ if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
log "ERROR invalid world content"
exit 1
fi
mv "$baseDir" "$worldDest"
rsync --remove-source-files --recursive --delete "$baseDir/" "$worldDest"
else
log "Cloning world directory from $WORLD ..."
cp -r "$WORLD" "$worldDest"
rsync --recursive --delete "${WORLD%/}"/ "$worldDest"
fi

if [ "$TYPE" = "SPIGOT" ]; then
Expand Down

0 comments on commit 092b530

Please sign in to comment.