Fix breakage on migration of legacy vertx installs.

This commit is contained in:
Marco Vermeulen
2013-04-17 10:16:02 +01:00
parent 25b893e696
commit fcb50e7f01
3 changed files with 8 additions and 1 deletions

View File

@@ -65,7 +65,7 @@ mkdir -p "${GVM_DIR}/gradle"
mkdir -p "${GVM_DIR}/griffon"
mkdir -p "${GVM_DIR}/grails"
if [[ -d "${GVM_DIR}/vert.x" ]]; then
if [[ -d "${GVM_DIR}/vert.x" && ! -d "${GVM_DIR}/vertx" ]]; then
mv "${GVM_DIR}/vert.x" "${GVM_DIR}/vertx"
else
mkdir -p "${GVM_DIR}/vertx"

View File

@@ -32,6 +32,7 @@ Feature: Self Update
Scenario: Rename the vertx Candidate on Upgrade
Given the candidate "vert.x" version "1.3.0.final" is already installed and default
And the candidate "vertx" does not exist
When I enter "gvm selfupdate"
Then the candidate "vertx" version "1.3.0.final" is installed
And the candidate "vert.x" version "1.3.0.final" is not installed

View File

@@ -50,6 +50,12 @@ Given(~'^the candidate "([^"]*)" version "([^"]*)" does not exist$') { String ca
assert ! versions.contains(version)
}
And(~'^the candidate "([^"]*)" does not exist$') { String candidate ->
def candidateDir = "${gvmDir}/${candidate}" as File
candidateDir.deleteDir()
assert ! candidateDir.exists()
}
And(~'^I have a local candidate "([^"]*)" version "([^"]*)" at "([^"]*)"$') { String candidate, String version, String directory ->
prepareLocalCandidateFolder directory, candidate, version
}