Run multiple grunt tasks in a single .bat file

Is it possible to run two grunt tasks in one .bat script? I am trying to do the following:

grunt --param = val1 --force grunt --param = val2 --force

But only the first task was launched. Any ideas?

+7
batch-file gruntjs
source share
2 answers

Grunt will exit your BAT when it ends (I don’t know why, but it is). So that you continue to work even after exiting the command line, you will need to use the "call" function:

call grunt --your-args-here-1 call grunt --your-args-here-2 

Note that if the first grunt fails, you will still run the second grunt. I am not sure how to solve this, and I do not need it, hope ^ _ ^

+16
source share
 start /wait /b "" "grunt --param=val1 --force" start /wait /b "" "grunt --param=val2 --force" 

try this ... ;)

0
source share

All Articles