我正在尝试创建一个 Grunt 任务来运行Modulus部署。我已经在本地安装了Modulus npm 模块,以及运行任务的grunt-shell模块。这是我的 Gruntfile 的相关部分:
grunt.initConfig({
shell: {
deploy: {
command: 'modulus deploy',
options: {
cwd: 'node_modules/.bin/'
}
}
}
});
grunt.registerTask('deploy', ['shell:deploy']);
现在,如果我直接在命令行上运行模数命令,我会得到:
$ modulus deploy
Welcome to Modulus
[Error] Need to be logged in to execute this command.
Please log in with "modulus login" command.
但是,当我运行 grunt 任务时,这就是我得到的:
$ grunt deploy
Running "shell:deploy" (shell) task
Welcome to Modulus
Done, without errors.
Grunt 命令文件的输出比在 Grunt 之外运行相同的命令本身要短得多,并且缺少一些关键信息。这可能是什么原因?执行是否可以在完全结束之前返回,从而给我一个不完整的标准输出?