Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grunt execution stops batch script

I am doing development with cordova and yeoman + angularjs. I have adopted a folder structure as follows (output of dir command on windows):

C:\code\cordova\pg-droid-app>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 404D-C81B

 Directory of C:\code\cordova\pg-droid-app

01/01/2015  03:46 PM    <DIR>          .
01/01/2015  03:46 PM    <DIR>          ..
01/01/2015  03:10 PM    <DIR>          pgdroid
01/01/2015  03:50 PM    <DIR>          pgdroid-app-frontend
01/01/2015  03:50 PM               241 showapp.bat
               1 File(s)            241 bytes
               4 Dir(s)  65,102,319,616 bytes free

pgdroid-app-frontend is the folder I've run yo angular (the yeoman generator-angular). pgdroid is the folder where the cordova project is setup.

Grunt is configured to copy output of my HTML dev work to pgdroid\www folder. It works fine.

Now to make things easier I've created the following batch script (showapp.bat):

echo === Running grunt... ===
cd pgdroid-app-frontend
grunt --force
echo === End Running grunt... ===
echo === Running cordova emulator ===
cd ..\pgdroid
cordova run android
cd ..
echo === End Running cordova emulator ===

The file is placed in the root directory (see the first output shared here). The script execution stops after grunt is executed. I am guessing this is the grunt program behaviour. It perhaps doesn't return a success exit code which may be the reason the script stops abrupt.

Whats the workaround for this?

like image 840
deostroll Avatar asked Jan 01 '15 10:01

deostroll


1 Answers

grunt is somewhat behaves like a .bat (windows batch) file or a batch program. Hence within a batch program, if you want to execute another batch program, you have to prefix call before it.

call grunt --force
like image 100
deostroll Avatar answered Sep 30 '22 23:09

deostroll