pulled store art never goes into the app repo: art pull --write, init and onboard add the renders folder (relative to the repo root, e.g. /store/renders/) to the repo's .gitignore when git check-ignore says it is not ignored yet, with one line saying so; tests

This commit is contained in:
CRTkafa 2026-10-14 04:31:55 +08:00
parent 81915651bd
commit fb3a7c186b
6 changed files with 69 additions and 3 deletions

View file

@ -30,6 +30,7 @@ import {
posix, type Pulled, PULLED_FILE, readPulled, type RemoteArt, sha256Of, slotOf, sniffExt, storeEmptySets, summarize, thumbSize,
} from './lib/art-pull';
import { playClient } from './play/client';
import { ignoreInRepo } from './lib/git-ignore';
import { decodePng, hashGray, imageSimilarity } from './lib/imagehash';
import { IMAGE_SPECS, checkImage, imageInfo } from './shots/spec';
@ -260,6 +261,8 @@ export interface PullReport {
storeEmpty: string[];
notes: string[];
written: boolean;
/** The line added to the app repo's ignore file (pulled art is never committed), or null. */
gitignored?: string | null;
manifest: string;
}
@ -365,6 +368,8 @@ export async function artPull(ctx: Ctx, o: { store?: string; write: boolean; for
writeFileSync(join(p.renders, PULLED_FILE), JSON.stringify(next, null, 2) + '\n');
report.written = true;
}
// pulled store art never goes into the app's repo
if (existsSync(p.renders)) report.gitignored = ignoreInRepo(p.renders, 'storebound: store art (rendered or pulled from the stores), never committed');
if (failed.length) { report.notes.push(...failed.map(f => `failed: ${f}`)); process.exitCode = 1; }
return report;
}
@ -387,6 +392,7 @@ export function printPull(r: PullReport, write: boolean): void {
for (const s of r.stores) (s.ok ? log : warn)(TAG, s.ok ? `${s.store === 'apple' ? 'App Store' : 'Google Play'}: ${s.images} image(s)${s.version ? `, version ${s.version}` : ''}` : `${s.store}: could not read: ${s.error}`);
if (r.steps.length) console.log(textTable(['action', 'files', 'why'], groupSteps(r.steps)));
for (const u of r.unmapped) log(TAG, `${u}: no language in the config has this locale (not pulled)`);
if (r.gitignored) log(TAG, `.gitignore: added ${r.gitignored} (store art stays out of the repo)`);
for (const n of r.notes) warn(TAG, n);
if (r.conflicts.length) warn(TAG, `${r.conflicts.length} local file(s) differ from the store and are kept: ${r.conflicts.slice(0, 8).join(', ')}${r.conflicts.length > 8 ? ', ...' : ''} (--force replaces them with the store's)`);
const s = r.summary;