-
Notifications
You must be signed in to change notification settings - Fork 0
/
poigen
executable file
·28 lines (19 loc) · 1.4 KB
/
poigen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
set -x
set -e
set -o pipefail
export IN_POIGEN=1
ORIGINAL_MESSAGE=$(jq -cr '.message' "${OVERVIEWER_OUTPUT_DIRECTORY}/progress.json")
# Trim ORIGINAL_MESSAGE to everything before the first semicolon
ORIGINAL_MESSAGE=${ORIGINAL_MESSAGE%;*}
jq -nc '{message: "POIgen in progress.... This usually takes 1.5~2.0 hours.", update: (60 * 1000), messageTime: '"$(date -u +%s)"'}' > "${OVERVIEWER_OUTPUT_DIRECTORY}/progress.json"
/opt/python/3.10.13/bin/python3.10 /opt/The-Minecraft-Overviewer/overviewer.py -p 3 --genpoi --config=config.py
# Regenerate the web assets. This is done by mapgen automatically, so is unnecessary 99% of the time.
# This is useful in cases where web assets are updated by an Overviewer upgrade, but a mapgen has not been run.
# In any case, this should take a couple of seconds at most, so no harm in just running it anyway.
/opt/python/3.10.13/bin/python3.10 /opt/The-Minecraft-Overviewer/overviewer.py --config=config.py --update-web-assets
/opt/dart-sass/sass -s compressed icons/overviewer.scss icons/overviewer.css
rm -r "${OVERVIEWER_OUTPUT_DIRECTORY}/custom-icons"
mkdir "${OVERVIEWER_OUTPUT_DIRECTORY}/custom-icons"
cp -r icons/* "${OVERVIEWER_OUTPUT_DIRECTORY}/custom-icons/"
jq -nc '{message: "'"${ORIGINAL_MESSAGE}"'; map is updated daily at 00:00, 06:00, 12:00, and 18:00 UTC", update: (60 * 1000), messageTime: '"$(date -u +%s)"'}' > "${OVERVIEWER_OUTPUT_DIRECTORY}/progress.json"