From 22cec732312567c632afd8aeb187e23f757ed6fa Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Sat, 26 Jan 2013 07:11:47 +0000 Subject: [PATCH] Minor tweaks to auto install configuration and cukes. --- src/main/resources/scripts/gvm-install.sh | 2 +- src/main/resources/scripts/gvm-use.sh | 2 +- src/test/cucumber/gvm/install_candidate.feature | 2 +- src/test/cucumber/gvm/use_and_default_candidate.feature | 2 +- src/test/resources/gvm/installation_steps.groovy | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/scripts/gvm-install.sh b/src/main/resources/scripts/gvm-install.sh index 230c2bb2..d3677ff0 100644 --- a/src/main/resources/scripts/gvm-install.sh +++ b/src/main/resources/scripts/gvm-install.sh @@ -31,7 +31,7 @@ function __gvmtool_install { if [[ ${VERSION_VALID} == 'valid' ]]; then __gvmtool_install_candidate_version "${CANDIDATE}" "${VERSION}" || return 1 - if [[ -z "${gvm_auto_answer}" ]]; then + if [[ "${gvm_auto_answer}" != 'true' ]]; then echo -n "Do you want ${CANDIDATE} ${VERSION} to be set as default? (Y/n): " read USE fi diff --git a/src/main/resources/scripts/gvm-use.sh b/src/main/resources/scripts/gvm-use.sh index c5a9978d..8cf4aead 100644 --- a/src/main/resources/scripts/gvm-use.sh +++ b/src/main/resources/scripts/gvm-use.sh @@ -24,7 +24,7 @@ function __gvmtool_use { if [[ "${GVM_ONLINE}" == "true" && ! -d "${GVM_DIR}/${CANDIDATE}/${VERSION}" ]]; then echo "" echo "Stop! ${CANDIDATE} ${VERSION} is not installed." - if [[ -z "${gvm_auto_answer}" ]]; then + if [[ "${gvm_auto_answer}" != 'true' ]]; then echo -n "Do you want to install it now? (Y/n): " read INSTALL fi diff --git a/src/test/cucumber/gvm/install_candidate.feature b/src/test/cucumber/gvm/install_candidate.feature index a85b8942..fb640245 100644 --- a/src/test/cucumber/gvm/install_candidate.feature +++ b/src/test/cucumber/gvm/install_candidate.feature @@ -32,7 +32,7 @@ Feature: Install Candidate Then the candidate "grails" version "2.1.0" should be the default Scenario: Install a candidate and select to use it automatically - And I have configured autoinstall="Y" + And I have configured "gvm_auto_answer" to "true" When I enter "gvm install grails 2.1.0" Then the candidate "grails" version "2.1.0" is installed And I see "Done installing!" diff --git a/src/test/cucumber/gvm/use_and_default_candidate.feature b/src/test/cucumber/gvm/use_and_default_candidate.feature index d07a50f2..0b9c7f88 100644 --- a/src/test/cucumber/gvm/use_and_default_candidate.feature +++ b/src/test/cucumber/gvm/use_and_default_candidate.feature @@ -21,7 +21,7 @@ Feature: Use and Default Candidate And the candidate "groovy" version "1.8.8" should be in use Scenario: Use a candidate version that is automatically installed - And I have configured autoinstall="Y" + And I have configured "gvm_auto_answer" to "true" When I enter "gvm use groovy 1.8.8" Then I see "Stop! groovy 1.8.8 is not installed." Then I see "Using groovy version 1.8.8 in this shell." diff --git a/src/test/resources/gvm/installation_steps.groovy b/src/test/resources/gvm/installation_steps.groovy index bf18cd91..3fada250 100644 --- a/src/test/resources/gvm/installation_steps.groovy +++ b/src/test/resources/gvm/installation_steps.groovy @@ -80,9 +80,9 @@ And(~'^the candidate "([^"]*)" version "([^"]*)" is already linked to "([^"]*)"$ Files.createSymbolicLink(link, target) } -And(~'^I have configured autoinstall="([^"]*)"$') { String flag -> +And(~'^I have configured "([^"]*)" to "([^"]*)"$') { String configName, String flag -> def configFile = new File("$gvmDir/etc/config") - configFile.write "gvm_auto_answer=${flag}" + configFile.write "${configName}=${flag}" } private prepareCandidateFolder(String baseDir, String candidate, String version) {