Skip to content

Commit dffc670

Browse files
authored
Fixed issue with symlink already exists error on Android (#160)
Instead of deleting and creating if the symlink exists, we now only creates it if the symlink does not exist.
1 parent f835461 commit dffc670

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

package/scripts/install-npm.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ const createSymlink = (p) => {
88
const srcDir = path.resolve(`./cpp/${p}`);
99
const dstDir = path.resolve(`./android/cpp/${p}`);
1010

11-
if (fs.existsSync(dstDir)) {
12-
fs.unlinkSync(dstDir);
11+
if (!fs.existsSync(dstDir)) {
12+
fs.symlinkSync(srcDir, dstDir, "dir");
1313
}
14-
15-
fs.symlinkSync(srcDir, dstDir, "dir");
1614
};
1715

1816
// Copy common cpp files from the package root to the android folder

0 commit comments

Comments
 (0)