NuKeeperDotNet/NuKeeper

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

chuseman opened this issue ยท 1 comments

๐Ÿ› 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:

  • ๐Ÿ› ๏ธ NuKeeper CLI
  • โœจ GitHub
  • ๐Ÿค– AzureDevops
  • ๐Ÿ Bitbucket
  • ๐ŸŒŽ Gitlab
  • ๐Ÿ“บ Gitea
  • ๐Ÿณ Docker

I believe PopulateSettings is blocking it in LocalNuKeeperCommand:

if (!string.IsNullOrWhiteSpace(Path) && !Directory.Exists(Path))
{
return ValidationResult.Failure($"Path '{Path}' was not found");
}

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.