games status: both stores' game services in one read-only report (CLI, MCP games_status, desktop read method); --json status output stays pure JSON

This commit is contained in:
CRTkafa 2026-10-21 05:07:58 +07:00
parent a4c31e096b
commit 26f0723641
7 changed files with 23 additions and 4 deletions

View file

@ -72,13 +72,13 @@ export async function run(ctx: Ctx): Promise<void> {
const pgs = hasAndroidProject(root) ? readPgsProject(root) : null;
const project = pgs ? pgsFindings(config, pgs) : [];
const appId = config.games!.playGames!.appId ?? pgs?.appId?.value;
for (const f of project) (f.level === 'ok' ? log : warn)(TAG, `${f.msg}${f.fix ? ` (${f.fix})` : ''}`);
if (!a.has('json')) for (const f of project) (f.level === 'ok' ? log : warn)(TAG, `${f.msg}${f.fix ? ` (${f.fix})` : ''}`);
if (!appId) throw new Error('games.playGames.appId is not set and the Android project has no games_APP_ID: create the games project first (storebound console plan play-games-services), then set the id');
const c = gamesConfigClient(root);
const have = await readPlayGames(c, appId);
const locale = playDefaultLocale(config);
const plan = planPlayGames(config.games!, config.languages, locale, have);
if (a.has('json')) console.log(JSON.stringify({ appId, leaderboards: have.leaderboards.length, achievements: have.achievements.length, project, plan }, null, 2));
if (a.has('json')) { console.log(JSON.stringify({ appId, leaderboards: have.leaderboards.length, achievements: have.achievements.length, project, plan }, null, 2)); return; }
if (sub === 'status' || a.has('dry')) {
if (!a.has('json')) console.log(dryPlan(`play games (project ${appId})`, planRows(plan)));
return;