-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(fs): fix copying of symlink directories on Windows #6278
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -137,7 +137,7 @@ async function copySymLink( | |||||
) { | ||||||
await ensureValidCopy(src, dest, options); | ||||||
const originSrcFilePath = await Deno.readLink(src); | ||||||
const type = getFileInfoType(await Deno.lstat(src)); | ||||||
const type = getFileInfoType(await Deno.lstat(originSrcFilePath)); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this only works when I think this should |
||||||
if (isWindows) { | ||||||
await Deno.symlink(originSrcFilePath, dest, { | ||||||
type: type === "dir" ? "dir" : "file", | ||||||
|
@@ -161,7 +161,7 @@ function copySymlinkSync( | |||||
) { | ||||||
ensureValidCopySync(src, dest, options); | ||||||
const originSrcFilePath = Deno.readLinkSync(src); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using
Suggested change
|
||||||
const type = getFileInfoType(Deno.lstatSync(src)); | ||||||
const type = getFileInfoType(Deno.lstatSync(originSrcFilePath)); | ||||||
if (isWindows) { | ||||||
Deno.symlinkSync(originSrcFilePath, dest, { | ||||||
type: type === "dir" ? "dir" : "file", | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
Deno.realPath
should return the absolute path of the symlink target. Additional explanation for suggestion in PR #6236:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think changing this to
realPath
causes another problem. I think we should keep this work for relative symlinks.