diff --git a/scripts/stage-bundled-plugin-runtime.mjs b/scripts/stage-bundled-plugin-runtime.mjs index 4735549e160..f38f52aa6c5 100644 --- a/scripts/stage-bundled-plugin-runtime.mjs +++ b/scripts/stage-bundled-plugin-runtime.mjs @@ -7,32 +7,13 @@ function symlinkType() { return process.platform === "win32" ? "junction" : "dir"; } -function shouldFallbackToWindowsFileLink(error, type) { - return ( - process.platform === "win32" && - type !== symlinkType() && - error && - typeof error === "object" && - "code" in error && - (error.code === "EPERM" || error.code === "EACCES") - ); -} - function relativeSymlinkTarget(sourcePath, targetPath) { const relativeTarget = path.relative(path.dirname(targetPath), sourcePath); return relativeTarget || "."; } function symlinkPath(sourcePath, targetPath, type) { - try { - fs.symlinkSync(relativeSymlinkTarget(sourcePath, targetPath), targetPath, type); - } catch (error) { - if (shouldFallbackToWindowsFileLink(error, type)) { - fs.linkSync(sourcePath, targetPath); - return; - } - throw error; - } + fs.symlinkSync(relativeSymlinkTarget(sourcePath, targetPath), targetPath, type); } function shouldWrapRuntimeJsFile(sourcePath) {