Skip to content

Commit

Permalink
Merge pull request #40 from NikitaDudin/handle-symlink-errors
Browse files Browse the repository at this point in the history
Handle symlink error when copying files from cpp to android/cpp
  • Loading branch information
chrfalch authored Dec 22, 2021
2 parents 55dfb2a + 4e722e8 commit e563eb9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions package/scripts/install-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ console.log("Updating symlinks for Android build...");

const createSymlink = (p) => {
console.log(`Creating symlink to ${p}`, __dirname, process.cwd());
fs.symlinkSync(
path.resolve(`./cpp/${p}`),
path.resolve(`./android/cpp/${p}`),
"dir"
);
const srcDir = path.resolve(`./cpp/${p}`);
const dstDir = path.resolve(`./android/cpp/${p}`);

if (fs.existsSync(dstDir)) {
fs.unlinkSync(dstDir);
}

fs.symlinkSync(srcDir, dstDir, "dir");
};

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

0 comments on commit e563eb9

Please sign in to comment.