mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46: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: { },
|
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, '../..');
|
const basePath = path.resolve(__dirname, '../..');
|
||||||
|
|
||||||
async function linkModules() {
|
async function linkModules() {
|
||||||
@@ -55,7 +47,7 @@ async function linkModules() {
|
|||||||
if (stats.isDirectory()) {
|
if (stats.isDirectory()) {
|
||||||
await file.linkDirs(srcPath, destPath, true);
|
await file.linkDirs(srcPath, destPath, true);
|
||||||
} else {
|
} else {
|
||||||
await linkIfLinux(srcPath, destPath);
|
await fs.promises.copyFile(srcPath, destPath);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user