Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cleanAssetCatalog error #41865

Closed
wants to merge 2 commits into from

Conversation

janicduplessis
Copy link
Contributor

Summary:

There is currently an error when building in release on iOS when using asset catalogs (experimental feature that is partially merged #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

Test Plan:

Tested in an app that uses asset catalogs

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Dec 8, 2023
@facebook-github-bot
Copy link
Contributor

@dmytrorykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

.filter(file => file.endsWith('.imageset'));
for (const file of files) {
fs.rmSync(path.join(catalogDir, file));
.filter(imageSet => imageSet.endsWith('.imageset'));
Copy link
Member

@huntie huntie Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It's inaccurate to rename this to imageSet within this filter call, given these are candidates within the search directory. Let's use file or fileOrDir (which in this case is technically a file, directory, or package).

(I also don't mind the previous generic naming of files for the outer variable — until there is a future need to remove multiple kinds of files differently.)

@janicduplessis
Copy link
Contributor Author

@huntie Makes sense, lets just keep the current naming.

@facebook-github-bot
Copy link
Contributor

@huntie has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 12, 2023
@facebook-github-bot
Copy link
Contributor

@huntie merged this pull request in d5114a4.

@janicduplessis janicduplessis deleted the patch-16 branch December 12, 2023 22:19
Othinn pushed a commit to Othinn/react-native that referenced this pull request Jan 9, 2024
Summary:
There is currently an error when building in release on iOS when using asset catalogs (experimental feature that is partially merged facebook#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: facebook#41865

Test Plan: Tested in an app that uses asset catalogs

Reviewed By: NickGerleman

Differential Revision: D52032258

Pulled By: huntie

fbshipit-source-id: 1dc0ca09e0da0d514b03d7d72707bdcaef03301d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants