Skip to content

Commit 96bf07d

Browse files
authored
Fixes path separator issues and adds default value for packge-feed-url argument (#8)
1 parent 41783d9 commit 96bf07d

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"program": "${workspaceRoot}/Solutions/Endjin.SemVer.DotNetApi.Cli/bin/Debug/netcoreapp3.1/nupkgversion",
12+
"args": [
13+
"${workspaceRoot}"
14+
],
15+
"cwd": "${workspaceRoot}",
16+
"stopAtEntry": false,
17+
"console": "internalConsole"
18+
},
19+
]
20+
}

Solutions/Endjin.SemVer.DotNetApi.Cli/Endjin/SemVer/DotNetApi/Cli/CommandLineParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ RootCommand Root()
6969
Arity = ArgumentArity.ExactlyOne,
7070
});
7171

72-
cmd.AddArgument(new Argument<Uri>
72+
cmd.AddArgument(new Argument<Uri>(getDefaultValue: () => new Uri("https://api.nuget.org/v3/index.json") )
7373
{
7474
Name = "package-feed-url",
7575
Description = "Uri of the package feed to compare against.",

Solutions/Endjin.SemVer.DotNetApi/Endjin/SemVer/DotNetApi/PackageComparison/PackageCollectionComparisonOrchestrator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ bool IsXmlDocFile(string name) =>
250250
biggestChangeSeen = biggestChangeSeen.AtLeast(SemanticVersionChange.Minor);
251251
}
252252

253-
string workingFolder = Path.Combine(Path.GetTempPath(), @"endjin\nupkgversion\" + Guid.NewGuid());
254-
string predecessorFolder = workingFolder + @"\before";
255-
string targetFolder = workingFolder + @"\after";
253+
string workingFolder = Path.Combine(Path.GetTempPath(), "endjin", "nupkgversion", Guid.NewGuid().ToString());
254+
string predecessorFolder = Path.Combine(workingFolder, "before");
255+
string targetFolder = Path.Combine(workingFolder, "after");
256256

257257
try
258258
{
@@ -268,8 +268,8 @@ bool IsXmlDocFile(string name) =>
268268
if (libItem.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
269269
{
270270
Console.WriteLine(" Comparing " + libItem);
271-
string predecessorPath = predecessorFolder + "\\" + libItem;
272-
string targetPath = targetFolder + "\\" + libItem;
271+
string predecessorPath = Path.Combine(predecessorFolder, libItem);
272+
string targetPath = Path.Combine(targetFolder, libItem);
273273

274274
SemanticVersionChange changeForThisItem = CheckAssembliesForSemverChanges(predecessorPath, targetPath);
275275
Console.WriteLine(" " + changeForThisItem);

0 commit comments

Comments
 (0)