Skip to content

Commit

Permalink
(chocolateyGH-14) If source runner already installed, move on
Browse files Browse the repository at this point in the history
If the runner is already installed, don't log a message that the
required package is already installed. Otherwise it could cause
confusion.
  • Loading branch information
ferventcoder committed Jan 22, 2015
1 parent 8e67207 commit a4f685d
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions src/chocolatey/infrastructure.app/services/WebPiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,26 @@ public SourceType SourceType
public void ensure_source_app_installed(ChocolateyConfiguration config, Action<PackageResult> ensureAction)
{
var runnerConfig = new ChocolateyConfiguration()
{
CommandName = "install",
PackageNames = ApplicationParameters.SourceRunner.WebPiPackage,
Sources = ApplicationParameters.ChocolateyCommunityFeedSource,
Debug = config.Debug,
Force = config.Force,
Verbose = config.Verbose,
CommandExecutionTimeoutSeconds = config.CommandExecutionTimeoutSeconds,
CacheLocation = config.CacheLocation,
RegularOuptut = config.RegularOuptut,
};

_nugetService.install_run(runnerConfig, ensureAction.Invoke);
{
PackageNames = ApplicationParameters.SourceRunner.WebPiPackage,
Sources = ApplicationParameters.PackagesLocation,
Debug = config.Debug,
Force = config.Force,
Verbose = config.Verbose,
CommandExecutionTimeoutSeconds = config.CommandExecutionTimeoutSeconds,
CacheLocation = config.CacheLocation,
RegularOuptut = config.RegularOuptut,
};
runnerConfig.ListCommand.LocalOnly = true;

var localPackages = _nugetService.list_run(runnerConfig, logResults: false);

if (!localPackages.ContainsKey(ApplicationParameters.SourceRunner.WebPiPackage))
{
runnerConfig.Sources = ApplicationParameters.ChocolateyCommunityFeedSource;

_nugetService.install_run(runnerConfig, ensureAction.Invoke);
}
}

public void list_noop(ChocolateyConfiguration config)
Expand Down

0 comments on commit a4f685d

Please sign in to comment.