-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Move test into the PackageService so it happens during execution regardless of how it's called. Also did a minor refactor of line 431/436 to make the intent more readable.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,9 +81,14 @@ public IEnumerable<PackageResult> list_run(ChocolateyConfiguration config) | |
{ | ||
var packages = new List<IPackage>(); | ||
|
||
if (config.ListCommand.LocalOnly) | ||
{ | ||
config.Sources = ApplicationParameters.PackagesLocation; | ||
config.Prerelease = true; | ||
} | ||
foreach (var package in _nugetService.list_run(config)) | ||
{ | ||
if (!config.ListCommand.LocalOnly && !config.ListCommand.IncludeRegistryPrograms) | ||
if (!config.ListCommand.LocalOnly || !config.ListCommand.IncludeRegistryPrograms) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Jaykul
Author
Owner
|
||
{ | ||
yield return package; | ||
} | ||
|
@@ -428,7 +433,7 @@ public ConcurrentDictionary<string, PackageResult> uninstall_run(ChocolateyConfi | |
this.Log().Info(@"Uninstalling the following packages:"); | ||
this.Log().Info(ChocolateyLoggers.Important, @"{0}".format_with(config.PackageNames)); | ||
|
||
foreach (var packageConfigFile in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null().Where(p => p.EndsWith(".config")).ToList()) | ||
if (config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null().Any(p => p.EndsWith(".config"))) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
{ | ||
throw new ApplicationException("A packages.config file is only used with installs."); | ||
} | ||
|
What does this change do?