mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-09-23 14:10:30 +00:00
loops only if there are JSON files present
This commit is contained in:
@@ -24,17 +24,15 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
||||||
if [[ ! -z "find . -name '$*.json'" ]]; then
|
echo "Checking for JSON files."
|
||||||
echo "Checking JSON files"
|
JSON_FILES=$(find . -name '*.json')
|
||||||
for j in *.json; do
|
for j in $JSON_FILES; do
|
||||||
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
|
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
|
||||||
echo "Fixing JSON $j"
|
echo "Fixing JSON $j"
|
||||||
echo '[]' > $j
|
echo '[]' > $j
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
|
||||||
echo "Skipping JSON check. No files present."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If any modules have been provided, copy them over
|
# If any modules have been provided, copy them over
|
||||||
mkdir -p /data/mods
|
mkdir -p /data/mods
|
||||||
|
|||||||
Reference in New Issue
Block a user