From ed110e96eb89fe41ac6c42ecdbdfce43f82c8b9d Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Thu, 17 Jan 2019 17:39:48 -0600 Subject: [PATCH] (GH-661) allow local only without sources When no sources are active and someone is searching a local source, allow that to continue without throwing an error. This will allow the sources to be configured to the local source a littler further in and then return results instead of throwing an error. --- .../infrastructure.app/services/ChocolateyPackageService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs index 9f9ea1cc69..c86313c3ea 100644 --- a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs +++ b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs @@ -161,7 +161,7 @@ public void list_noop(ChocolateyConfiguration config) public IEnumerable list_run(ChocolateyConfiguration config) { - if (string.IsNullOrWhiteSpace(config.Sources)) + if (string.IsNullOrWhiteSpace(config.Sources) && !config.ListCommand.LocalOnly) { this.Log().Error(ChocolateyLoggers.Important, @"Unable to search for packages when there are no sources enabled for packages and none were passed as arguments.");