Skip to content

Commit d73c742

Browse files
committed
ensure that int is returned so that S.CL handles failing exit codes
1 parent c0021b0 commit d73c742

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Cli/dotnet/Commands/Add/Package/AddPackageParser.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,17 @@ private static CliCommand ConstructCommand()
3131
command.Options.Add(PackageAddCommandParser.PrereleaseOption);
3232
command.Options.Add(PackageCommandParser.ProjectOption);
3333

34-
command.SetAction((parseResult) => {
34+
command.SetAction((parseResult) =>
35+
{
3536
// this command can be called with an argument or an option for the project path - we prefer the option.
3637
// if the option is not present, we use the argument value instead.
3738
if (parseResult.HasOption(PackageCommandParser.ProjectOption))
3839
{
39-
new AddPackageReferenceCommand(parseResult, parseResult.GetValue(PackageCommandParser.ProjectOption)).Execute();
40+
return new AddPackageReferenceCommand(parseResult, parseResult.GetValue(PackageCommandParser.ProjectOption)).Execute();
4041
}
4142
else
4243
{
43-
new AddPackageReferenceCommand(parseResult, parseResult.GetValue(AddCommandParser.ProjectArgument)).Execute();
44+
return new AddPackageReferenceCommand(parseResult, parseResult.GetValue(AddCommandParser.ProjectArgument)).Execute();
4445
}
4546
});
4647

0 commit comments

Comments
 (0)