From d5114a4b9f079bc0d643f3d6f303310bd78074eb Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Tue, 12 Dec 2023 13:34:19 -0800 Subject: [PATCH] Fix cleanAssetCatalog error (#41865) Summary: There is currently an error when building in release on iOS when using asset catalogs (experimental feature that is partially merged https://github.com/facebook/react-native/pull/30129) This was probably incorrectly migrated from the community cli repo. `.imageset` is actually folders so it needs to be removed with `{recursive: true, force: true}`. I also renamed the variable `files` which is confusing since its folders. ## Changelog: [IOS] [FIXED] - Fix cleanAssetCatalog error Pull Request resolved: https://github.com/facebook/react-native/pull/41865 Test Plan: Tested in an app that uses asset catalogs Reviewed By: NickGerleman Differential Revision: D52032258 Pulled By: huntie fbshipit-source-id: 1dc0ca09e0da0d514b03d7d72707bdcaef03301d --- .../community-cli-plugin/src/commands/bundle/assetCatalogIOS.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/community-cli-plugin/src/commands/bundle/assetCatalogIOS.js b/packages/community-cli-plugin/src/commands/bundle/assetCatalogIOS.js index 6adc884e3a869d..8ef0b9d35adb77 100644 --- a/packages/community-cli-plugin/src/commands/bundle/assetCatalogIOS.js +++ b/packages/community-cli-plugin/src/commands/bundle/assetCatalogIOS.js @@ -20,7 +20,7 @@ export function cleanAssetCatalog(catalogDir: string): void { .readdirSync(catalogDir) .filter(file => file.endsWith('.imageset')); for (const file of files) { - fs.rmSync(path.join(catalogDir, file)); + fs.rmSync(path.join(catalogDir, file), {recursive: true, force: true}); } }