SpongeVanilla integration and JSON check fix

This commit is contained in:
Aitor Ramos Sasselli
2017-11-01 22:06:05 +01:00
parent ee5a95baa8
commit f178c6c0a1
4 changed files with 54 additions and 8 deletions
+11 -6
View File
@@ -24,12 +24,17 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then
fi
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
for j in *.json; do
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
echo "Fixing JSON $j"
echo '[]' > $j
fi
done
if [[ -z "ls *.json" ]]; then
echo "Checking JSON files"
for j in *.json; do
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
echo "Fixing JSON $j"
echo '[]' > $j
fi
done
else
echo "Skipping JSON check. No files present."
fi
# If any modules have been provided, copy them over
mkdir -p /data/mods