fix(switch): tell users to run --fetch when love-nx pin missing

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andrew Quenehen
2026-08-01 12:47:26 -03:00
parent 4df09010a8
commit bd181271d9
2 changed files with 13 additions and 10 deletions
+7 -5
View File
@@ -10,17 +10,18 @@
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# shellcheck source=common.sh
. "$SCRIPT_DIR/common.sh"
LOVE_NRO="$ROOT/.bazinga/love-nx/11.5-nx1/love.nro"
GAME_LOVE="${1:-$ROOT/.bazinga/work/game.love}"
OUT_DIR="$ROOT/dist/switch/loose"
OUT_NRO="$OUT_DIR/gen1recomp.nro"
OUT_LOVE="$OUT_DIR/game.love"
fail() { printf 'error: %s\n' "$*" >&2; exit 1; }
if [ ! -f "$LOVE_NRO" ]; then
fail "missing pinned love.nro at $LOVE_NRO — fetch per docs/switch-development.md"
fail_need_fetch "missing pinned love.nro at $LOVE_NRO"
fi
if [ ! -f "$GAME_LOVE" ]; then
@@ -35,4 +36,5 @@ echo "assembled loose Switch dist:"
echo " $OUT_NRO"
echo " $OUT_LOVE"
echo ""
shasum -a 256 "$OUT_NRO" "$OUT_LOVE"
printf '%s %s\n' "$(sha256_file "$OUT_NRO")" "$OUT_NRO"
printf '%s %s\n' "$(sha256_file "$OUT_LOVE")" "$OUT_LOVE"
+6 -5
View File
@@ -3,13 +3,14 @@
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# shellcheck source=common.sh
. "$SCRIPT_DIR/common.sh"
LOVE_NX_TAG="11.5-nx1"
LOVE_NX_DIR="$ROOT/.bazinga/love-nx/$LOVE_NX_TAG"
MANIFEST="$ROOT/scripts/switch/love-nx-11.5-nx1.sha256"
fail() { printf 'error: %s\n' "$*" >&2; exit 1; }
read_manifest_hash() {
local name="$1"
local line hash
@@ -27,8 +28,8 @@ verify_file() {
local path="$LOVE_NX_DIR/$name"
local expected actual
expected="$(read_manifest_hash "$name")"
[ -f "$path" ] || fail "missing pinned $name at $path — fetch per docs/switch-development.md"
actual="$(shasum -a 256 "$path" | awk '{print $1}')"
[ -f "$path" ] || fail_need_fetch "missing pinned $name at $path"
actual="$(sha256_file "$path")"
[ "$actual" = "$expected" ] \
|| fail "$name checksum mismatch (expected $expected, got $actual)"
}