You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is by design (as I implemented it back in the days), and the path (containing ..) is a valid path, so saying "invalid" is stretching it a bit. "Not what I expected" is probably better choice of words here 🙂
context.Environment.WorkingDirectory = context.MakeAbsolute(context.Directory("C:/temp/repo/build"));
var b = context.MakeAbsolute(context.Directory(".")); // C:/temp/repo/build
var d = context.MakeAbsolute(b.Combine(new DirectoryPath("../Dashboards"))); // C:/temp/repo/build/../Dashboards
var f = context.File("C:/repos/repo/build/Dashboards/file.ext"); // C:/temp/repo/build/Dashboards/file.ext
var r = context.MakeRelative(f, d); // ../../../../../repos/repo/build/Dashboards/file.ext
var a = context.MakeAbsolute(r); // C:/repos/repo/build/Dashboards/file.ext
I this code, shouldn't r b just tile.ext? The resulting value is higher than the file system's root.
Is there a way to normalize the path and get rid of all . and ..?
Prerequisites
Cake runner
Cake Frosting
Cake version
5.0.0
Operating system
Windows
Operating system architecture
x64
CI Server
No response
What are you seeing?
What is expected?
Steps to Reproduce
Output log
No response
The text was updated successfully, but these errors were encountered: