botc-mc-scripts/load-script.sh
Nick Guy 895f6c94b5 Add debug log for script deployment in load-script.sh
This commit adds a log message to indicate when and where the script file is being deployed. This improves clarity and helps with troubleshooting during resource pack generation.
2025-06-02 22:16:10 +01:00

31 lines
No EOL
802 B
Bash
Executable file

#/usr/bin/env bash
DIR=$(realpath $(dirname $0))
script_name=$1
shift
if [[ -e /.dockerenv ]]; then
root_dir="/scripts"
else
root_dir="/pelican/data/botc"
fi
if [[ "${script_name}x" != "x" ]]; then
script_file="${root_dir}/${script_name}.png"
else
script_file="${DIR}/templates/map_background.png"
fi
# Instantiate template
map_file="${DIR}/templates/texture-pack/assets/minecraft/textures/map/map_background.png"
rm ${map_file}
echo "Deploying \"${script_file}\" to \"${map_file}\""
cp ${script_file} ${map_file}
# Package resource pack
pushd "${DIR}/templates"
mkdir -p "${root_dir}/files"
rm "${root_dir}/files/botc-script-resource-pack.zip"
zip -r "${root_dir}/files/botc-script-resource-pack.zip" texture-pack
echo "Writing to \"${root_dir}/files/botc-script-resource-pack.zip\""
popd