unimonkiez / react-native-asset

Linking and unlinking of assets 🔥
302 stars 52 forks source link

Ignore .DS_Store is not working #24

Open neiker opened 5 years ago

neiker commented 5 years ago

Hi! This seems to now work on version 2.0.0

react-native.config.js:

module.exports = {
  assets: ['./assets/fonts/'],
};

ios/link-assets-manifest.json:

{
  "migIndex": 1,
  "data": [
    {
      "path": "assets/fonts/.DS_Store",
      "sha1": "df2fbeb1400acda0909a32c1cf6bf492f1121e07"
    },
    {
      "path": "assets/fonts/Rubik-Black.ttf",
      "sha1": "ac5408131f3693795f4e9049e78f1d18f1ed19fb"
    },
    {
      "path": "assets/fonts/Rubik-BlackItalic.ttf",
      "sha1": "313caf026d4cc607a0874e97c2c836ab7c296aba"
    },
    {
      "path": "assets/fonts/Rubik-Bold.ttf",
      "sha1": "37d3e9933d7ea3cd1ea9048a929a9392c506538f"
    },
    {
      "path": "assets/fonts/Rubik-BoldItalic.ttf",
      "sha1": "60119c0b523c3b0712e956fa53b99adce01a3c91"
    },
    {
      "path": "assets/fonts/Rubik-Light.ttf",
      "sha1": "ab626c8a0e663e9daf5b5064783e06ebfef9c80b"
    },
    {
      "path": "assets/fonts/Rubik-LightItalic.ttf",
      "sha1": "7e6c1d6a4347713349c49846bb066aaddc825cec"
    },
    {
      "path": "assets/fonts/Rubik-Medium.ttf",
      "sha1": "1c7160fa20ccc42db9a1fc9245cd8f9367a428ea"
    },
    {
      "path": "assets/fonts/Rubik-MediumItalic.ttf",
      "sha1": "61761978e3bfdd077f9799d2e491306ec205c869"
    },
    {
      "path": "assets/fonts/Rubik-Regular.ttf",
      "sha1": "688c0cbc43d63c4f63cb997018fe889915a9dc7b"
    },
    {
      "path": "assets/fonts/Rubik-RegularItalic.ttf",
      "sha1": "2c0bc181562295cba66d1e23da977237324ca5fc"
    }
  ]
}

android/link-assets-manifest.json:

{
  "migIndex": 1,
  "data": [
    {
      "path": "assets/fonts/.DS_Store",
      "sha1": "df2fbeb1400acda0909a32c1cf6bf492f1121e07"
    },
    {
      "path": "assets/fonts/Rubik-Black.ttf",
      "sha1": "ac5408131f3693795f4e9049e78f1d18f1ed19fb"
    },
    {
      "path": "assets/fonts/Rubik-BlackItalic.ttf",
      "sha1": "313caf026d4cc607a0874e97c2c836ab7c296aba"
    },
    {
      "path": "assets/fonts/Rubik-Bold.ttf",
      "sha1": "37d3e9933d7ea3cd1ea9048a929a9392c506538f"
    },
    {
      "path": "assets/fonts/Rubik-BoldItalic.ttf",
      "sha1": "60119c0b523c3b0712e956fa53b99adce01a3c91"
    },
    {
      "path": "assets/fonts/Rubik-Light.ttf",
      "sha1": "ab626c8a0e663e9daf5b5064783e06ebfef9c80b"
    },
    {
      "path": "assets/fonts/Rubik-LightItalic.ttf",
      "sha1": "7e6c1d6a4347713349c49846bb066aaddc825cec"
    },
    {
      "path": "assets/fonts/Rubik-Medium.ttf",
      "sha1": "1c7160fa20ccc42db9a1fc9245cd8f9367a428ea"
    },
    {
      "path": "assets/fonts/Rubik-MediumItalic.ttf",
      "sha1": "61761978e3bfdd077f9799d2e491306ec205c869"
    },
    {
      "path": "assets/fonts/Rubik-Regular.ttf",
      "sha1": "688c0cbc43d63c4f63cb997018fe889915a9dc7b"
    },
    {
      "path": "assets/fonts/Rubik-RegularItalic.ttf",
      "sha1": "2c0bc181562295cba66d1e23da977237324ca5fc"
    }
  ]
}
unimonkiez commented 5 years ago

Seems like a bug, somewhere over these lines.

Edit: Can't do it myself because I'm busy with school stuff, but anyone is welcome to PR and i'll publish the change.

gusparis commented 4 years ago

@neiker @unimonkiez I have made a PR to fix this, but in the meantime you can patch it up with this using patch-release library.


index d51ac19..b3b15ca 100644
--- a/node_modules/react-native-asset/lib/index.js
+++ b/node_modules/react-native-asset/lib/index.js
@@ -137,6 +137,7 @@ const linkPlatform = ({
   });

   manifest.write(assets
+    .filter(filterFilesToIgnore)
     .map(asset => Object.assign(
       {},
       asset, ```
unimonkiez commented 4 years ago

Fixed in #30