#!/usr/bin/env bash # Print the candidate package identity as JSON (engine/extension/pck sha256 + # architectures). Shared by run_client_gate.sh and playable_test.sh so the # per-run build.json and the release manifest are computed the same way. set -euo pipefail if [ "${1:-}" = "--help" ] || [ "$#" -ne 1 ]; then echo "用法: script/playable_build_info.sh APP" >&2 [ "${1:-}" = "--help" ] && exit 0 exit 2 fi app="$1" engine="$app/Contents/MacOS/mtgodot-poc" pck="$app/Contents/Resources/mtgodot-poc.pck" dylib="$(find "$app/Contents/Frameworks" -maxdepth 1 -type f -name '*.dylib' 2>/dev/null | LC_ALL=C sort | head -n 1)" sha256_of() { if [ -n "$1" ] && [ -f "$1" ]; then shasum -a 256 "$1" | awk '{print $1}'; else printf ''; fi } archs="" if [ -f "$engine" ]; then archs="$(lipo -archs "$engine" 2>/dev/null | tr ' ' '+' || true)"; fi node -e ' const [engine, extension, pck, arch] = process.argv.slice(1); process.stdout.write(JSON.stringify({ engine_sha256: engine, extension_sha256: extension, pck_sha256: pck, arch }) + "\n"); ' "$(sha256_of "$engine")" "$(sha256_of "$dylib")" "$(sha256_of "$pck")" "$archs"