Skip to content

Commit 148772d

Browse files
committed
Added '--accept-source-agreements' to all 'list' commands (#)
1 parent 29ab5d4 commit 148772d

2 files changed

Lines changed: 27 additions & 30 deletions

File tree

src/WGet.NET/Components/WinGetPackageManager.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public async Task<List<WinGetPackage>> SearchPackageAsync(string packageId, stri
241241
/// </exception>
242242
public List<WinGetPackage> GetInstalledPackages()
243243
{
244-
ProcessResult result = Execute(_listCmd);
244+
ProcessResult result = Execute(AcceptSourceAgreements(_listCmd));
245245

246246
return ProcessOutputReader.ToPackageList(result.Output, PackageAction.InstalledList);
247247
}
@@ -269,7 +269,7 @@ public List<WinGetPackage> GetInstalledPackages(string packageId, bool exact = f
269269
{
270270
ArgsHelper.ThrowIfStringIsNullOrWhiteSpace(packageId, "packageId");
271271

272-
string cmd = string.Format(_searchInstalledCmd, packageId);
272+
string cmd = string.Format(AcceptSourceAgreements(_searchInstalledCmd), packageId);
273273

274274
if (exact)
275275
{
@@ -308,7 +308,7 @@ public List<WinGetPackage> GetInstalledPackages(string packageId, string sourceN
308308
ArgsHelper.ThrowIfStringIsNullOrWhiteSpace(packageId, "packageId");
309309
ArgsHelper.ThrowIfStringIsNullOrWhiteSpace(sourceName, "sourceName");
310310

311-
string cmd = string.Format(_searchInstalledBySourceCmd, packageId, sourceName);
311+
string cmd = string.Format(AcceptSourceAgreements(_searchInstalledBySourceCmd), packageId, sourceName);
312312

313313
if (exact)
314314
{
@@ -335,7 +335,7 @@ public List<WinGetPackage> GetInstalledPackages(string packageId, string sourceN
335335
/// </exception>
336336
public async Task<List<WinGetPackage>> GetInstalledPackagesAsync(CancellationToken cancellationToken = default)
337337
{
338-
ProcessResult result = await ExecuteAsync(_listCmd, false, cancellationToken);
338+
ProcessResult result = await ExecuteAsync(AcceptSourceAgreements(_listCmd), false, cancellationToken);
339339

340340
// Return empty list if the task was cancled
341341
if (cancellationToken.IsCancellationRequested)
@@ -373,7 +373,7 @@ public async Task<List<WinGetPackage>> GetInstalledPackagesAsync(string packageI
373373
{
374374
ArgsHelper.ThrowIfStringIsNullOrWhiteSpace(packageId, "packageId");
375375

376-
string cmd = string.Format(_searchInstalledCmd, packageId);
376+
string cmd = string.Format(AcceptSourceAgreements(_searchInstalledCmd), packageId);
377377

378378
if (exact)
379379
{
@@ -422,7 +422,7 @@ public async Task<List<WinGetPackage>> GetInstalledPackagesAsync(string packageI
422422
ArgsHelper.ThrowIfStringIsNullOrWhiteSpace(packageId, "packageId");
423423
ArgsHelper.ThrowIfStringIsNullOrWhiteSpace(sourceName, "sourceName");
424424

425-
string cmd = string.Format(_searchInstalledBySourceCmd, packageId, sourceName);
425+
string cmd = string.Format(AcceptSourceAgreements(_searchInstalledBySourceCmd), packageId, sourceName);
426426

427427
if (exact)
428428
{

src/WGet.NET/XmlDocumentation/WGet.NET.xml

Lines changed: 21 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)