grails clean run-app on Windows bat file

batch-file, build, build-automation, grails, grails-2.0

Solution

The Batch file below allows you to invoke it with several grails options like in your first example:

@echo off
:nextOption
   if "%~1" equ "" goto :EOF
   call grails %1
   shift
goto nextOption

For example, if previous Batch file is called CALLGRAILS.BAT, you can do this:

callgrails clean run-app

Of course, you may rename CALLGRAILS.BAT as you wish.

Problem

`grails clean run-app` is not a command. You need to run `grails clean` then `grails run-app`. If I create a bat file with the following: ``` grails clean grails run-app ``` The script ends after clean. run-app is never called. How can I run both in a bat file?

Original source