mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: EEXISTS error on linux if plugin/theme overrides core js file
This commit is contained in:
@@ -27,14 +27,6 @@ JS.scripts = {
|
||||
modules: { },
|
||||
};
|
||||
|
||||
async function linkIfLinux(srcPath, destPath) {
|
||||
if (process.platform === 'win32') {
|
||||
await fs.promises.copyFile(srcPath, destPath);
|
||||
} else {
|
||||
await file.link(srcPath, destPath, true);
|
||||
}
|
||||
}
|
||||
|
||||
const basePath = path.resolve(__dirname, '../..');
|
||||
|
||||
async function linkModules() {
|
||||
@@ -55,7 +47,7 @@ async function linkModules() {
|
||||
if (stats.isDirectory()) {
|
||||
await file.linkDirs(srcPath, destPath, true);
|
||||
} else {
|
||||
await linkIfLinux(srcPath, destPath);
|
||||
await fs.promises.copyFile(srcPath, destPath);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user