create-mekanism-modular/tools/bb-open.sh

17 lines
884 B
Bash
Executable File

#!/usr/bin/env bash
# Regenerate the placement project from the live JSON and open it.
#
# bb-open.sh regenerate from the module files, then open
# bb-open.sh --keep open what is already there, without regenerating
#
# Regenerating is the default because the project is a view of the module JSON,
# not a second copy of it: anything changed in the files since the last export
# should be what you see.
set -euo pipefail
REPO=/home/themiro/code.dev/create-mekanism-modular
JAR=$(ls "/home/themiro/.var/app/org.prismlauncher.PrismLauncher/data/PrismLauncher/instances/AbdelPack Delta/minecraft/mods/"Truly-Modular-armory-*.jar | head -1)
OUT=$REPO/placement.bbmodel
[ "${1:-}" = "--keep" ] || "$REPO/tools/.venv/bin/python" "$REPO/tools/bb_export.py" "$JAR" "$OUT"
setsid flatpak run net.blockbench.Blockbench "$OUT" >/dev/null 2>&1 < /dev/null &
echo "opening $OUT"