(Quick Reference)

create-script

Purpose

The create-script command creates a new Grails executable script that can be run with the grails command from a terminal window.

Examples

The command:

Propósito

El comando create-script crea un nuevo script Grails ejecutable que puede ser ejecutado con el comando grails desde una consola en Windows.

Ejemplos

El comando:

grails create-script execute-report

Creates a script called scripts/ExecuteReport.groovy such as:
Crea un script llamado scripts/ExecuteReport.groovy tal como:
target('default': "The description of the script goes here!") {
    doStuff()
}
target(doStuff: "The implementation task") {
   // logic here
}

The command can then be run with:

El comando puede entonces ser ejecutado con:

grails execute-report

Description

The command will translate lower case command names separated by hyphens into a valid Groovy camel-cased class name. For example create-controller would become a script called scripts/CreateController.groovy.

The script generated is a Gant script which can use Gant's capabilities to depend on other scripts from Grails core. Refer to the section on Command Line Scripting in the user guide.

Usage:

Descripción

El comando traducirá los nombre de comando en minúsculas separados por guiones dentro del nombre de una clase Groovy válida camel-cased. Por ejemplo create-controller se convertirá en un script llamado scripts/CreateController.groovy.

El script generado es un script Gant:http://groovy.codehaus.org/Gant el cual puede usar las capacidades del Gant para depender de otros scripts del nucleo Grails. Consulte la sección Command Line Scripting de la guía de usuario.

Uso:

grails create-script [name]

Fired Events:

  • CreatedFile - When the script has been created

  • CreatedFile - Cuando el script ha sido creado