From 616033b001f40dfa073a14c9371403e0bcc49f36 Mon Sep 17 00:00:00 2001 From: Christian Rondeau Date: Tue, 24 Mar 2015 22:20:45 -0400 Subject: [PATCH] (GH-181) Use prompt_for_confirmation_short for yes/no choices --- .../services/ChocolateyPackageService.cs | 2 +- .../infrastructure.app/services/PowershellService.cs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs index d7802d03b1..5d46922bd3 100644 --- a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs +++ b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs @@ -618,7 +618,7 @@ private void rollback_previous_version(ChocolateyConfiguration config, PackageRe var rollback = true; if (config.PromptForConfirmation) { - var selection = InteractivePrompt.prompt_for_confirmation(" Unsuccessful operation for {0}.{1} Do you want to rollback to previous version (package files only)?".format_with(packageResult.Name, Environment.NewLine), new[] { "yes", "no" }, "yes", requireAnswer: true); + var selection = InteractivePrompt.prompt_for_confirmation_short(" Unsuccessful operation for {0}.{1} Do you want to rollback to previous version (package files only)?".format_with(packageResult.Name, Environment.NewLine), new[] { "yes", "no" }); if (selection.is_equal_to("no")) rollback = false; } diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index 23ec61ecd7..d6aa92925b 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -204,13 +204,12 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack this.Log().Info(ChocolateyLoggers.Important, () => " Found '{0}':".format_with(_fileSystem.get_file_name(chocoPowerShellScript))); this.Log().Info(() => "{0}{1}{0}".format_with(Environment.NewLine, chocoPowerShellScriptContents)); var selection = InteractivePrompt - .prompt_for_confirmation(@" -Do you want to run the script? + .prompt_for_confirmation_short( +@"Do you want to run the script? NOTE: If you choose not to run the script, the installation will fail. - Skip is an advanced option and most likely will never be wanted. -" - , new[] {"yes", "no", "skip"}, "no", requireAnswer: true); + Skip is an advanced option and most likely will never be wanted." + , new[] {"yes", "no", "skip"}); if (selection.is_equal_to("yes")) shouldRun = true; if (selection.is_equal_to("no")) {