-
Notifications
You must be signed in to change notification settings - Fork 588
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 Shell.mv #2309
Fix Shell.mv #2309
Conversation
Release 5.13.3
Co-authored-by: Matthias Dittrich <matthi.d@gmail.com>
Moving for directories isn't working... |
a good start, thanks for taking a look at this. Just FYI some tests are still failing, what I use is something like |
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.
Looks good, thanks a lot for taking care of this. I can take care of the remaining things, just let me know if you want to do it or if you disagree with anything.
@@ -25,3 +25,9 @@ module FileSystemInfo = | |||
| :? FileInfo as file -> File(file) | |||
| :? DirectoryInfo as dir -> Directory(dir, dir.EnumerateFileSystemInfos()) | |||
| _ -> failwith "No file or directory given." | |||
|
|||
let moveTo (fileSysInfo: FileSystemInfo) dest = |
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.
We should either have docs or mark this internal
(which is what I probably would go with for now).
If we want to add this public API we should briefly discuss the order of the arguments.
What I mean: We should decide if we expect this API to be used like FileSystemInfo.moveTo src dst
or like
src
|> FileSystemInfo.moveTo dst
in which case we have to re-order the arguments.
match fi with | ||
| FileSystemInfo.Directory (d, _) -> | ||
let targetName = target @@ fi.Name | ||
d.MoveTo(targetName) |> ignore |
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.
can we write ignore<DirectoryInfo>
here (or whatever MoveTo
returns here)?
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.
The method returns void
, so I guess we don't need to ignore
?
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.
Indeed
src/app/Fake.IO.FileSystem/Shell.fs
Outdated
let fi_src = FileSystemInfo.ofPath src | ||
let fi_dest = FileSystemInfo.ofPath dest | ||
if not fi_dest.Exists then rename dest src | ||
else begin |
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 begin
and end
can be removed
Thanks! |
Please revert... that code was not compiling... Sorry |
It's ok, will fix and start the release process :) |
Honestly, I didn't expect |
Description
Fixes #2293
TODO
help/markdown
)help/templates/template.cshtml
, linking to the API-reference is fine.dotnet sln Fake.sln add src/app/Fake.*/Fake.*.fsproj
)