Files
homelabstack/stacks/romhacks/orchestrator/run.sh
T
ginnoir 1360a8fa65 feat(romhacks): automated hand-off — route downloads to RomM + library, render notes
handoff.py classifies completed downloads (console rom vs RPG-Maker fangame vs
patch, via bsdtar archive peek incl. RAR5), copies console roms into
Emulation/roms/<platform> for RomM, moves the full folder (rom + guides) into
the library archive, and renders note.md + handoff.json per hack for the
Obsidian publish step. Wired into the cycle; single /data mount keeps moves as
fast renames. Validated on 4 real games.
2026-06-07 20:25:30 -05:00

19 lines
699 B
Bash

#!/bin/sh
# Harvest loop. Stays idle (no export, no enqueue) until the alt-account token and
# guild id are configured, so deploying the stack unconfigured is harmless.
set -u
POLL_INTERVAL="${POLL_INTERVAL:-21600}"
while true; do
# Route any completed downloads first (fast; independent of Discord access),
# then export + enqueue new threads.
python3 /app/handoff.py || echo "[romhacks] handoff failed (exit $?)"
if [ -z "${DISCORD_TOKEN:-}" ] || [ -z "${GUILD_ID:-}" ]; then
echo "[romhacks] DISCORD_TOKEN/GUILD_ID not set — idle. Sleeping ${POLL_INTERVAL}s."
else
python3 /app/orchestrate.py || echo "[romhacks] cycle failed (exit $?)"
fi
sleep "${POLL_INTERVAL}"
done