Skip to content

Commit

Permalink
(maint) formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ferventcoder committed Sep 1, 2016
1 parent 0e2d683 commit f4ae1c9
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,12 +1030,12 @@ public ConcurrentDictionary<string, PackageResult> uninstall_run(ChocolateyConfi
&& (installerExists || portableExists || cmdLineExists)
)
{
var actualPackageName = installerExists ?
"{0}.install".format_with(packageName)
: portableExists ?
"{0}.portable".format_with(packageName)
var actualPackageName = installerExists ?
"{0}.install".format_with(packageName)
: portableExists ?
"{0}.portable".format_with(packageName)
: "{0}.commandline".format_with(packageName);

var timeoutInSeconds = config.PromptForConfirmation ? 0 : 20;
this.Log().Warn(@"You are uninstalling {0}, which is likely a metapackage for an
*.install/*.portable package that it installed
Expand Down Expand Up @@ -1190,7 +1190,7 @@ public ConcurrentDictionary<string, PackageResult> uninstall_run(ChocolateyConfi
}
}
}

return packageUninstalls;
}

Expand Down Expand Up @@ -1248,10 +1248,22 @@ public void remove_installation_files(IPackage removedPackage, ChocolateyPackage

private IEnumerable<PackageResult> get_all_intalled_packages(ChocolateyConfiguration config)
{
//todo : move to deep copy for get all installed
//var listConfig = config.deep_copy();
//listConfig.ListCommand.LocalOnly = true;
//listConfig.Noop = false;
//listConfig.PackageNames = string.Empty;
//listConfig.Input = string.Empty;
//listConfig.QuietOutput = true;

//return list_run(listConfig).ToList();

config.ListCommand.LocalOnly = true;
var sources = config.Sources;
//changed by the command automatically when LocalOnly = true
config.Sources = ApplicationParameters.PackagesLocation;
var pre = config.Prerelease;
//changed by the command automatically when LocalOnly = true
config.Prerelease = true;
var noop = config.Noop;
config.Noop = false;
Expand Down Expand Up @@ -1279,11 +1291,11 @@ private void set_package_names_if_all_is_specified(ChocolateyConfiguration confi
if (config.PackageNames.is_equal_to(ApplicationParameters.AllPackages))
{
var packagesToUpdate = get_all_intalled_packages(config).Select(p => p.Name).ToList();

if (!string.IsNullOrWhiteSpace(config.UpgradeCommand.PackageNamesToSkip))
{
var packagesToSkip = config.UpgradeCommand.PackageNamesToSkip
.Split(new [] {','}, StringSplitOptions.RemoveEmptyEntries)
.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
.Where(item => !string.IsNullOrWhiteSpace(item))
.Select(p => p.trim_safe())
.ToList();
Expand Down

0 comments on commit f4ae1c9

Please sign in to comment.