Skip to content

Commit

Permalink
Implement --config-file param in dotnet.exe
Browse files Browse the repository at this point in the history
  • Loading branch information
aortiz-msft committed Sep 26, 2022
1 parent 0c551dc commit 4b2d8b6
Show file tree
Hide file tree
Showing 8 changed files with 543 additions and 83 deletions.
2 changes: 1 addition & 1 deletion src/NuGet.Clients/NuGet.CommandLine/NuGetCommand.resx
Original file line number Diff line number Diff line change
Expand Up @@ -921,4 +921,4 @@ nuget client-certs List</value>
<data name="Option_Help" xml:space="preserve">
<value>Show command help and usage information.</value>
</data>
</root>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Strings.Option_ConfigFile,
CommandOptionType.SingleValue);
var timeout = push.Option(
"-t|--timeout <timeout>",
Strings.Push_Timeout_Description,
Expand Down Expand Up @@ -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()),
enablePackageSourcesChangedEvent: false);
#pragma warning restore CS0618 // Type or member is obsolete
try
Expand Down
3 changes: 2 additions & 1 deletion src/NuGet.Core/NuGet.Commands/CommandRunners/PushRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public static Task Run(
bool skipDuplicate,
ILogger logger)
{
return Run(settings: settings,
return Run(
settings: settings,
sourceProvider: sourceProvider,
packagePaths: new[] { packagePath },
source: source,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public class HttpSourceAuthenticationHandler : DelegatingHandler
private readonly HttpClientHandler _clientHandler;
private readonly ICredentialService _credentialService;

#pragma warning disable CA2213
private readonly SemaphoreSlim _httpClientLock = new SemaphoreSlim(1, 1);
#pragma warning restore CA2213
private Dictionary<string, AmbientAuthenticationState> _authStates = new Dictionary<string, AmbientAuthenticationState>();
private HttpSourceCredentials _credentials;

Expand Down
Loading

0 comments on commit 4b2d8b6

Please sign in to comment.