mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
fix if link exists and try to link
This commit is contained in:
parent
3ce53e9dbd
commit
b92df5de51
@ -47,9 +47,16 @@ async function linkSharedResources(pkgJSON, packagePath) {
|
|||||||
fs.mkdirSync(path.resolve(finalLinkPath, ".."), { recursive: true })
|
fs.mkdirSync(path.resolve(finalLinkPath, ".."), { recursive: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.symlinkSync(originClassPath, finalLinkPath, "dir")
|
try {
|
||||||
|
fs.symlinkSync(originClassPath, finalLinkPath, "dir")
|
||||||
console.log(`🔗 Linked resouce [${resource}] to [${finalLinkPath}]`)
|
console.log(`🔗 Linked resouce [${resource}] to [${finalLinkPath}]`)
|
||||||
|
} catch (error) {
|
||||||
|
if (error.code && error.code == 'EEXIST') {
|
||||||
|
fs.unlinkSync(finalLinkPath)
|
||||||
|
fs.symlinkSync(originClassPath, finalLinkPath, "dir")
|
||||||
|
console.log(`🔗 Linked resouce [${resource}] to [${finalLinkPath}]`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user