Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.
Swift apple-siliconcustom-formathomebrewiosipaipadipadosiphonemetalnative-portnintendo-switchnxnativeromfsswitch-games
Badges: the game and verified counts read JSON the sync keeps current
LNPANDY4653d1bee1dc
diff --git a/README.md b/README.mdindex 3223a010..c115b46e 100644--- a/README.md+++ b/README.md@@ -10,8 +10,8 @@[](https://github.com/LNPANDY/NX2Apple/network/members)[](https://github.com/LNPANDY/NX2Apple/issues)[](LICENSE)-[](#supported-games)-[](#supported-games)+[](docs/badges/games.json)+[](docs/badges/verified.json)[](README.md)[](README.zh-CN.md)diff --git a/README.zh-CN.md b/README.zh-CN.mdindex b218c8ac..a79d6e7c 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -10,8 +10,8 @@[](https://github.com/LNPANDY/NX2Apple/network/members)[](https://github.com/LNPANDY/NX2Apple/issues)[](LICENSE)-[](#支持的游戏)-[](#支持的游戏)+[](docs/badges/games.json)+[](docs/badges/verified.json)[](README.md)[](README.zh-CN.md)diff --git a/scripts/sync_upstream.py b/scripts/sync_upstream.pyindex 3cab7e80..4494497e 100644--- a/scripts/sync_upstream.py+++ b/scripts/sync_upstream.py@@ -23,7 +23,7 @@ working tree, so CI can open an issue with the log instead.Usage: sync_upstream.py --old <upstream sha> --new <upstream sha> [--skip-build]"""-import argparse, os, subprocess, sys, shutil, tempfile+import argparse, json, os, subprocess, sys, shutil, tempfilefrom pathlib import PathREPO = Path(__file__).resolve().parent.parent@@ -593,6 +593,30 @@ def apply_changes(a, changes):fail(f'{path}: fork patch marker missing after sync: {MARKERS[path]!r}')+def refresh_badges():+ """Keep docs/badges/*.json in step with the tree, so the README badges need no hand edit.++ The game count is the number of title-ID profile folders (dm/games/0100…), which is what the+ README means by "N game profiles". The verified count is the rows marked verified in the+ README's own table, so the source of truth stays the README text rather than a second list."""+ gdir = REPO / 'dm/games'+ games = sum(1 for d in gdir.iterdir() if d.is_dir() and d.name.startswith('0100'))+ readme = (REPO / 'README.md').read_text(encoding='utf-8')+ verified = sum(1 for ln in readme.splitlines()+ if ln.startswith('| ') and ('**Verified here**' in ln or 'Verified —' in ln))+ for name, label, value, color in [('games', 'games', games, 'blue'),+ ('verified', 'verified on an iPhone', verified, 'success')]:+ p = REPO / 'docs/badges' / f'{name}.json'+ old = p.read_text(encoding='utf-8') if p.exists() else ''+ new = json.dumps({'schemaVersion': 1, 'label': label, 'message': str(value), 'color': color},+ indent=2) + '\n'+ if old != new:+ p.parent.mkdir(parents=True, exist_ok=True)+ p.write_text(new, encoding='utf-8')+ say(f' badge {name}: {value}')+ say(f'badges: {games} games, {verified} verified')++def main():ap = argparse.ArgumentParser()ap.add_argument('--old', required=True, help='upstream ref the fork is currently at')@@ -606,6 +630,7 @@ def main():try:apply_changes(a, changes)verify(a.skip_build)+ refresh_badges()except SyncProblem: passif problems:say(f'\nSYNC FAILED: {len(problems)} problem(s) — nothing committed; the working tree is left as the script wrote it, `git checkout -- .` restores it')