Skip to content
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

PathCollapser.Collapse shows wrong output for if .. is the second segment in the path #3858

Closed
2 tasks done
nils-a opened this issue Apr 4, 2022 · 1 comment · Fixed by #3865
Closed
2 tasks done
Assignees
Labels
Milestone

Comments

@nils-a
Copy link
Member

nils-a commented Apr 4, 2022

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake .NET Tool

Cake version

2.1.0

Operating system

Linux, Windows

Operating system architecture

64-Bit

CI Server

No response

What are you seeing?

Given the following script:

var target = Argument("target", "Default");

Task("Default")
.Does(() => {
   var one = new DirectoryPath("foo/../bar").Collapse();
   var two = new DirectoryPath("./foo/../bar").Collapse();
   Information("1: "+one);
   Information("2: "+two);
});

RunTarget(target);

The output is

========================================
Default
========================================
1: foo/bar
2: foo/bar

What is expected?

For a path foo/../bar or ./foo/../bar I would expect the output being bar.

Steps to Reproduce

See Cake script above.

Output log

No response

@nils-a nils-a self-assigned this Apr 7, 2022
@nils-a nils-a added the Bug label Apr 7, 2022
@nils-a nils-a linked a pull request Apr 7, 2022 that will close this issue
@nils-a nils-a added this to the v2.2.0 milestone Apr 7, 2022
devlead added a commit that referenced this issue Apr 14, 2022
(#3858, #3859) Made PathCollapser aware of different formats
@cake-build-bot
Copy link

🎉 This issue has been resolved in version v2.2.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants