-
-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dotnet tool: nbgv #191
Conversation
CC: @onovotny |
src/nbgv/Program.cs
Outdated
PackageId, | ||
new Dictionary<string, string> | ||
{ | ||
{ "Version", "2.1.23" }, // TODO: use the latest version... somehow... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to use the NuGet.Client v4 package to do this, but the only docs are for v3 and v4 seems to have made it... difficult.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the link. Interestingly enough it seems this is the line I was looking for.
I was pulling down Nuget.Client instead of NuGet.PackageManagement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm.. no, that doesn't work either. And v4.7.0 doesn't even exist (on nuget.org) for that package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does seem to be on Nuget.org, but they're publishing it with build-metadata, which seems confusing:
https://www.nuget.org/packages/NuGet.PackageManagement/4.7.0
src/nbgv/nbgv.csproj
Outdated
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.CommandLine" Version="0.1.0-preview2-180503-2" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I used to use this but switched to
Microsoft.Extensions.CommandLineUtils
https://github.com/onovotny/SignService/blob/master/src/SignClient/SignClient.csproj#L11
Since it doesn't look like the other one will ever see any updates.
Works similarly as you can see here: https://github.com/onovotny/SignService/tree/master/src/SignClient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I'd given Nate McMaster's fork of that library I try but was disappointed by its apparent lack of support for sub-commands. Your sample demonstrates at least that it recognizes such a thing.
I'm pretty comfortable with the System.CommandLine pattern though, and since I'm publishing the package instead of shipping it with dependenceis to nuget.org, the fact that it will never ship doesn't bother me. I've used this package several times already.
But I'll check out the MS.Ex.CLU one at some point for my next project. Thanks for the tip.
This produces a warning on restore because the official NuGet package doesn't target .NET Core. :(
doc/nbgv-cli.md
Outdated
Perform a one-time install of the `nbgv` tool using the following dotnet CLI command: | ||
|
||
```cmd | ||
dotnet tool install -g nbgv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a common use is likely to be on CI servers/build scripts to get a version, is it worth mentioning local tools?
dotnet tool install nbgv --tool-path .
.\nbgv ...
That way it won't cause issues with anything else on the machine already and doesn't mess with global state.
Update the dotnet-install.ps1 script
As a high-level summary of the new nbgv dotnet console tool, here is the top-level usage text:
Additional help is available for each individual command.
Todo:
--help
trails themCloses #181