private static async Task <int> Main(string[] args) { int exitCode; using (BootstrapperApp bootstrapperApp = await BootstrapperApp.CreateAsync(args).ConfigureAwait(false)) { NuGetPackageInstallResult nuGetPackageInstallResult = await bootstrapperApp.ExecuteAsync(args.ToImmutableArray()).ConfigureAwait(false); exitCode = nuGetPackageInstallResult.SemanticVersion is {} &&
private static async Task <int> Main(string[] args) { int exitCode; using (BootstrapperApp bootstrapperApp = await BootstrapperApp.CreateAsync(args).ConfigureAwait(false)) { using var cts = new CancellationTokenSource(GetTimeout(args)); NuGetPackageInstallResult nuGetPackageInstallResult = await bootstrapperApp.ExecuteAsync(args.ToImmutableArray(), cts.Token).ConfigureAwait(false); exitCode = nuGetPackageInstallResult.SemanticVersion is {} &&
public async Task DownloadAsync() { string[] args = { Constants.AllowPreRelease, Constants.DownloadOnly }; using Logger logger = new LoggerConfiguration() .WriteTo.Debug() .MinimumLevel.Verbose() .CreateLogger(); using BootstrapperApp bootstrapperApp = await BootstrapperApp.CreateAsync(args, logger); NuGetPackageInstallResult nuGetPackageInstallResult = await bootstrapperApp.ExecuteAsync(args.ToImmutableArray()); Assert.NotNull(nuGetPackageInstallResult); Assert.NotNull(nuGetPackageInstallResult.NuGetPackageId); Assert.NotNull(nuGetPackageInstallResult.PackageDirectory); Assert.NotNull(nuGetPackageInstallResult.SemanticVersion); }