Skip to content

Commit

Permalink
fix: linking assets on Android (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee authored Mar 14, 2019
1 parent a79130c commit 07a9761
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"errorhandler": "^1.5.0",
"escape-string-regexp": "^1.0.5",
"execa": "^1.0.0",
"fs-extra": "^7.0.1",
"glob": "^7.1.1",
"graceful-fs": "^4.1.3",
"inquirer": "^3.0.6",
Expand Down
14 changes: 7 additions & 7 deletions packages/cli/src/commands/link/android/copyAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import fs from 'fs';
import fs from 'fs-extra';
import path from 'path';
import groupFilesByType from '../groupFilesByType';

Expand All @@ -23,10 +23,10 @@ export default function copyAssetsAndroid(
) {
const assets = groupFilesByType(files);

(assets.font || []).forEach(asset =>
fs.copyFileSync(
asset,
path.join(project.assetsPath, 'fonts', path.basename(asset)),
),
);
(assets.font || []).forEach(asset => {
const fontsDir = path.join(project.assetsPath, 'fonts');
// @todo: replace with fs.mkdirSync(path, {recursive}) + fs.copyFileSync
// and get rid of fs-extra once we move to Node 10
fs.copySync(asset, path.join(fontsDir, path.basename(asset)));
});
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3518,7 +3518,7 @@ fs-extra@^1.0.0:
jsonfile "^2.1.0"
klaw "^1.0.0"

fs-extra@^7.0.0:
fs-extra@^7.0.0, fs-extra@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
Expand Down

0 comments on commit 07a9761

Please sign in to comment.