简体   繁体   English

grunt执行停止批处理脚本

[英]grunt execution stops batch script

I am doing development with cordova and yeoman + angularjs. 我正在使用cordova和yeoman + angularjs进行开发。 I have adopted a folder structure as follows (output of dir command on windows): 我采用了如下文件夹结构(在Windows上输出dir命令):

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-app-frontend是我用yo angular (yeoman generator-angular)运行的文件夹。 pgdroid is the folder where the cordova project is setup. pgdroid是设置cordova项目的文件夹。

Grunt is configured to copy output of my HTML dev work to pgdroid\\www folder. Grunt配置为将我的HTML开发工作的输出复制到pgdroid\\www文件夹。 It works fine. 它工作正常。

Now to make things easier I've created the following batch script ( showapp.bat ): 现在为了showapp.bat我创建了以下批处理脚本( 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. 执行grunt后脚本执行停止。 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? 这是什么解决方法?

grunt is somewhat behaves like a .bat (windows batch) file or a batch program. grunt有点像.bat (windows批处理)文件或批处理程序。 Hence within a batch program, if you want to execute another batch program, you have to prefix call before it. 因此,在批处理程序中,如果要执行另一个批处理程序,则必须在其前面call前缀。

call grunt --force

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM