-
Notifications
You must be signed in to change notification settings - Fork 694
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 --config-file param to dotnet nuget push command #4819
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -36,6 +36,11 @@ public static void Register(CommandLineApplication app, Func<ILogger> getLogger) | |||||
Strings.SymbolSource_Description, | ||||||
CommandOptionType.SingleValue); | ||||||
|
||||||
var configurationFile = push.Option( | ||||||
"--config-file <source>", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
In NuGet vocabulary, a source is a feed of packages. I don't know if this was a copy-paste issue, but source really doesn't feel right to me. I don't know if we should say
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just fyi |
||||||
Strings.Option_ConfigFile, | ||||||
CommandOptionType.SingleValue); | ||||||
|
||||||
var timeout = push.Option( | ||||||
"-t|--timeout <timeout>", | ||||||
Strings.Push_Timeout_Description, | ||||||
|
@@ -105,7 +110,9 @@ public static void Register(CommandLineApplication app, Func<ILogger> getLogger) | |||||
} | ||||||
|
||||||
#pragma warning disable CS0618 // Type or member is obsolete | ||||||
var sourceProvider = new PackageSourceProvider(XPlatUtility.GetSettingsForCurrentWorkingDirectory(), enablePackageSourcesChangedEvent: false); | ||||||
var sourceProvider = new PackageSourceProvider( | ||||||
XPlatUtility.ProcessConfigFile(configurationFile.Value()), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should add a validation to ensure file path exists before accessing it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, does This code, the way it's written, makes it look like a breaking change and that passing the |
||||||
enablePackageSourcesChangedEvent: false); | ||||||
#pragma warning restore CS0618 // Type or member is obsolete | ||||||
|
||||||
try | ||||||
|
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 looks like most other dotnet commands use
--configfile
, not--config-file
NuGet.Client/src/NuGet.Core/NuGet.CommandLine.XPlat/Commands/Commands.xml
Line 14 in 451713c
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-restore?tabs=netcore2x#options
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source#options