feat(@projects/@magic-civilization): ✨ add os-specific godot runner logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
300ec0c76d
commit
aaa7e24357
1 changed files with 38 additions and 14 deletions
|
|
@ -28,17 +28,41 @@ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||||
: "${CP_LOG_FILE:=}"
|
: "${CP_LOG_FILE:=}"
|
||||||
|
|
||||||
# Pure-headless mode — no Wayland needed. JSON-Lines speaks to stdout.
|
# Pure-headless mode — no Wayland needed. JSON-Lines speaks to stdout.
|
||||||
flatpak run --user \
|
#
|
||||||
--env=CP_SEED="$CP_SEED" \
|
# Linux uses flatpak Godot (matches the rest of the apricot pipeline).
|
||||||
--env=CP_PLAYERS="$CP_PLAYERS" \
|
# macOS uses the locally-installed `godot` binary (Homebrew); a parallel
|
||||||
--env=CP_CLAUDE_SLOT="$CP_CLAUDE_SLOT" \
|
# flatpak runtime just for this harness is silly when native Godot 4
|
||||||
--env=CP_MAP_SIZE="$CP_MAP_SIZE" \
|
# works directly. Env-var passthrough is automatic for the native path.
|
||||||
--env=CP_MAP_TYPE="$CP_MAP_TYPE" \
|
export CP_SEED CP_PLAYERS CP_CLAUDE_SLOT CP_MAP_SIZE CP_MAP_TYPE \
|
||||||
--env=CP_OMNISCIENT="$CP_OMNISCIENT" \
|
CP_OMNISCIENT CP_TIMEOUT_SEC CP_LOG_FILE
|
||||||
--env=CP_TIMEOUT_SEC="$CP_TIMEOUT_SEC" \
|
|
||||||
--env=CP_LOG_FILE="$CP_LOG_FILE" \
|
case "$(uname -s)" in
|
||||||
org.godotengine.Godot \
|
Darwin)
|
||||||
--path "$PROJECT_DIR/src/game" \
|
GODOT_BIN="${GODOT_BIN:-godot}"
|
||||||
--headless \
|
if ! command -v "$GODOT_BIN" >/dev/null 2>&1; then
|
||||||
--rendering-method gl_compatibility \
|
echo "ERROR: no godot binary on PATH (set GODOT_BIN or 'brew install godot')." >&2
|
||||||
res://engine/scenes/headless/claude_player_main.tscn
|
exit 1
|
||||||
|
fi
|
||||||
|
exec "$GODOT_BIN" \
|
||||||
|
--path "$PROJECT_DIR/src/game" \
|
||||||
|
--headless \
|
||||||
|
--rendering-method gl_compatibility \
|
||||||
|
res://engine/scenes/headless/claude_player_main.tscn
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exec flatpak run --user \
|
||||||
|
--env=CP_SEED="$CP_SEED" \
|
||||||
|
--env=CP_PLAYERS="$CP_PLAYERS" \
|
||||||
|
--env=CP_CLAUDE_SLOT="$CP_CLAUDE_SLOT" \
|
||||||
|
--env=CP_MAP_SIZE="$CP_MAP_SIZE" \
|
||||||
|
--env=CP_MAP_TYPE="$CP_MAP_TYPE" \
|
||||||
|
--env=CP_OMNISCIENT="$CP_OMNISCIENT" \
|
||||||
|
--env=CP_TIMEOUT_SEC="$CP_TIMEOUT_SEC" \
|
||||||
|
--env=CP_LOG_FILE="$CP_LOG_FILE" \
|
||||||
|
org.godotengine.Godot \
|
||||||
|
--path "$PROJECT_DIR/src/game" \
|
||||||
|
--headless \
|
||||||
|
--rendering-method gl_compatibility \
|
||||||
|
res://engine/scenes/headless/claude_player_main.tscn
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue