Browse files

Don't add duplicate font entries to plist during link (iOS)

**Test plan**

1. Add fonts using `react-native link` and a `"rnpm"` config in package.json
2. Manually delete one or more fonts from Xcode's Resources folder using Remove References option
3. Run `react-native link` again

With the patch in this PR, the plist will not accidentally get populated with duplicate entries.
Closes #12048

Differential Revision: D4560432

fbshipit-source-id: aba3733acfd5373f8d654406b06b8338b137bc07
  • Loading branch information...
mosesoak authored and facebook-github-bot committed Feb 15, 2017
1 parent 09fa9da commit c6c1c02b7539783037671388da0337bf616cbb51
Showing with 3 additions and 1 deletion.
  1. +3 −1 local-cli/link/ios/copyAssets.js
@@ -29,7 +29,9 @@ module.exports = function linkAssetsIOS(files, projectConfig) {
.filter(file => file) // xcode returns false if file is already there
.map(file => file.basename);
plist.UIAppFonts = (plist.UIAppFonts || []).concat(fonts);
const existingFonts = (plist.UIAppFonts || []);
const allFonts = [...existingFonts, ...fonts];
plist.UIAppFonts = Array.from(new Set(allFonts)); // use Set to dedupe w/existing

0 comments on commit c6c1c02

Please sign in to comment.