Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private static Command ConstructCommand()
}
else
{
return new PackageAddCommand(parseResult, parseResult.GetValue(AddCommandParser.ProjectArgument)).Execute();
return new PackageAddCommand(parseResult, parseResult.GetValue(AddCommandParser.ProjectArgument) ?? Directory.GetCurrentDirectory()).Execute();
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public ReferenceListCommand(

_fileOrDirectory = parseResult.HasOption(ReferenceCommandParser.ProjectOption) ?
parseResult.GetValue(ReferenceCommandParser.ProjectOption) :
parseResult.GetValue(ListCommandParser.SlnOrProjectArgument);
parseResult.GetValue(ListCommandParser.SlnOrProjectArgument) ??
Directory.GetCurrentDirectory();
Copy link
Preview

Copilot AI May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider explicitly handling directory formatting (e.g., trailing DirectorySeparatorChar) when defaulting to Directory.GetCurrentDirectory() to maintain consistency with file path expectations.

Suggested change
Directory.GetCurrentDirectory();
(Directory.GetCurrentDirectory().EndsWith(Path.DirectorySeparatorChar)
? Directory.GetCurrentDirectory()
: Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar);

Copilot uses AI. Check for mistakes.

}

public override int Execute()
Expand Down