NuKeeperDotNet / NuKeeper

Automagically update nuget packages in .NET projects
Apache License 2.0
540 stars 129 forks source link

CLI update command does not allow solutions or project files as path argument #1148

Open chuseman opened 2 years ago

chuseman commented 2 years ago

🐛 Bug Report

I'm unable to run nukeeper update with a solution file as the path argument.

Expected behavior

According to nukeeper update --help, the Path argument is:

The path to a .sln or project file, or to a directory containing a .NET solution/project. If none is specified, the current directory will be used.

So I'd expect that supplying a path to a solution or project file would update just that solution/project dependencies.

Reproduction steps

Invoke nukeeper update Project.sln (assuming Project.sln exists) and you'll get the error:

Path 'Project.sln' was not found

Configuration

Version: 0.35.0

Platform if applicable:

chuseman commented 2 years ago

I believe PopulateSettings is blocking it in LocalNuKeeperCommand:

https://github.com/NuKeeperDotNet/NuKeeper/blob/0d267f35ee5086bd7b5fc33563c94d728b260936/NuKeeper/Commands/LocalNuKeeperCommand.cs#L30-L33

I've tried fixing that specific instance to check for either Directory.Exists() or File.Exists() but then it fails later on. I'm hoping somebody more familiar with the project can shine some light on this (is the documentation just wrong?)

FWIW, this also affects nukeeper inspect but only when you don't supply other parameters (like -m 1). That's likely a separate bug where the path is just discarded.