Skip to content

Instantly share code, notes, and snippets.

@rserranon
Created January 3, 2012 01:44
Show Gist options
  • Save rserranon/1553024 to your computer and use it in GitHub Desktop.
Save rserranon/1553024 to your computer and use it in GitHub Desktop.
Script en groovy para seleccionar la version de Grails en Mac OS
#
# Script en groovy para seleccionar la version de Grails
# requiere el password de admin por el uso de sudo
#
def versions = ['1.1','1.1.2-M4','1.1.2','1.2-M3','1.2.0.RC1','1.2.0.RC2','1.2.0','1.3.4','1.3.5','1.3.6','1.4.0.M1', '2.0.0']
def helpOptions = ['-help','-HELP','-h','-?','?']
println ""
println "Selector de version de grails"
println ""
if (args.size() > 0) {
def parametro = args[0]
if (parametro in versions) {
def comando = "sudo rm /usr/share/grails"
println comando
println comando.execute().text
comando = "sudo ln -s /usr/share/grails-${parametro} /usr/share/grails"
println comando
println comando.execute().text
} else if (parametro in helpOptions) {
println "uso: comando <version>"
println "versiones disponibles: ${versions}"
} else
{
println "version no disponible"
println "versiones disponibles: ${versions}"
}
} else {
comando = ""
println "Por favor utilice: script <grails version> o -help para ayuda"
println "versiones disponibles: ${versions}"
}
println ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment