Add the Studio-created Pong project with a short match against CPU, pause, score and restart controls. Refresh legacy samples for current PBS input, RGBA colors and preloaded assets while preserving existing identities. Run convenience launchers against the current build and configured runtime; keep local caches and native assistant configuration ignored. Validation: shell syntax, JSON, registry identity/image preservation and whitespace checks passed. Pong ran in Studio as confirmed by the user. Build/pack/runtime validation of the refreshed samples remains pending.
36 lines
1.1 KiB
Bash
Executable File
36 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
PROJECT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
for artifact in program.pbx manifest.json assets.pa; do
|
|
if [ ! -f "$PROJECT_DIR/build/$artifact" ]; then
|
|
printf '%s\n' "Build this project in Studio Shipper before running it." >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
RUNTIME_PATH=${PROMETEU_RUNTIME:-}
|
|
if [ -z "$RUNTIME_PATH" ]; then
|
|
RUNTIME_PATH=$(python3 - "$PROJECT_DIR" <<'CONFIG_PY'
|
|
import json,sys
|
|
from pathlib import Path
|
|
root=Path(sys.argv[1])
|
|
setup=root/'.studio/setup.json'
|
|
try:
|
|
value=json.loads(setup.read_text()).get('prometeuRuntimePath') if setup.exists() else None
|
|
except (ValueError,OSError) as error:
|
|
raise SystemExit('Cannot read project runtime configuration: '+str(error))
|
|
print(value or root/'runtime')
|
|
CONFIG_PY
|
|
)
|
|
fi
|
|
case "$RUNTIME_PATH" in
|
|
/*) ;;
|
|
*) RUNTIME_PATH="$PROJECT_DIR/$RUNTIME_PATH" ;;
|
|
esac
|
|
if [ ! -x "$RUNTIME_PATH/prometeu" ]; then
|
|
printf '%s\n' "Runtime not found: $RUNTIME_PATH/prometeu" "Select it in Studio or set PROMETEU_RUNTIME to its installation directory." >&2
|
|
exit 1
|
|
fi
|
|
exec "$RUNTIME_PATH/prometeu" run "$PROJECT_DIR/build"
|