fix(apple): select only entries named Assets.car as asset catalogs (#4094)

inspect-asset-catalog selected every bundle entry whose relative path
ended in Assets.car, so an unrelated NotAssets.car directory was listed
as a skipped catalog and, with no real catalog present, failed the
inspection instead of returning the empty inventory; a regular file such
as OldAssets.car would have been sent to assetutil. The selector now
compares the final path component exactly.

Fixes #3914

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-15 05:21:17 -07:00
committed by GitHub
parent fc41b24dc4
commit befbc024c9
2 changed files with 6 additions and 1 deletions
@@ -68,6 +68,9 @@ describe("Apple asset catalog application workflow", () => {
const bundle = await createTestTempDirectory("rea-asset-catalog-absent-");
await mkdir(join(bundle, "Contents", "Resources"), { recursive: true });
await writeFile(join(bundle, "Contents", "Resources", "icon.icns"), "");
// Names that merely end in Assets.car are ordinary resources.
await mkdir(join(bundle, "Contents", "Resources", "NotAssets.car"));
await writeFile(join(bundle, "Contents", "Resources", "OldAssets.car"), "");
const result = await analyzeAppleAssetCatalogs({
environment: {},
bundlePath: bundle,
@@ -122,7 +122,9 @@ const collectAssetCatalogs = async (input: {
let totalMetadataBytes = 0;
try {
for await (const entry of reader.entries(input.signal)) {
if (!entry.path.endsWith("Assets.car")) continue;
// Reader paths are `/`-separated; only an entry named exactly
// Assets.car is a compiled catalog, not e.g. NotAssets.car.
if (entry.path.split("/").at(-1) !== "Assets.car") continue;
if (entry.kind !== "file") {
uninspected.push(`${entry.path} (${entry.kind})`);
continue;