-
Notifications
You must be signed in to change notification settings - Fork 694
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 package path issues when packing content into non-default locations inside nupkg #1135
Conversation
var setOfTargetPaths = new HashSet<string>(targetPaths, StringComparer.Ordinal); | ||
if (setOfTargetPaths.Remove("contentFiles" + Path.DirectorySeparatorChar) | ||
if (setOfTargetPaths.Remove("contentFiles" + Path.DirectorySeparatorChar) |
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.
does this need to check for the AltDirectorySeparatorChar also?
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.
good catch, added it .
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 overall. I suggest testing if using /
causes issues on windows since it is looking for \
. It is possible someone might author a project using forward slash because they are also working on linux.
foreach (var targetPath in setOfTargetPaths) | ||
{ | ||
var newTargetPath = Path.Combine(targetPath, identity); | ||
// We need to do this because evaluuated identity in the above line of code can be an empty string |
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.
typo:
because evaluuated identity
-> because the evaluated identity
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.
fixed
7e324d5
to
5ca7f78
Compare
@emgarten i added tests with both / and \ |
5ca7f78
to
11467ac
Compare
Fixes: NuGet/Home#4321
Added extensive test coverage for all possible input/output combinations of source path and packagepath.
CC: @rrelyea @emgarten @alpaix @mishra14 @jainaashish @nkolev92 @zhili1208