Resolve dereferenced symlinks relative to node_modules

This commit is contained in:
David Wilson
2018-12-13 10:04:36 -08:00
parent d3cfbf97f9
commit 4fa1dbff9a

View File

@@ -32,7 +32,7 @@ module.exports = function () {
// are duplicated in Atom's installation packages (see atom/atom#18490).
const nodeModulesPath = path.join(CONFIG.repositoryRootPath, 'node_modules')
glob.sync(path.join(nodeModulesPath, '*'))
.map(p => fs.lstatSync(p).isSymbolicLink() ? fs.readlinkSync(p) : p)
.map(p => fs.lstatSync(p).isSymbolicLink() ? path.resolve(nodeModulesPath, fs.readlinkSync(p)) : p)
.forEach(modulePath => {
const destPath = path.join(CONFIG.intermediateAppPath, 'node_modules', path.basename(modulePath))
fs.copySync(modulePath, destPath, { filter: includePathInPackagedApp })