Microsoft Foundry: drop unrelated Windows staging diff
Restore the bundled runtime staging script to upstream so this PR stays focused on the Microsoft Foundry provider and does not carry an unrelated Windows symlink fallback change.
This commit is contained in:
parent
3d2524a8c3
commit
e2f156246c
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user