使用Grunt构建、添加、提交并将我的代码推到Heroku。
构建、添加和提交都非常有效。
当我指定为"git推送heroku主“时,当进程运行时,我不会得到stdout。
下面是Grunt.js中的代码:
'git-push': {
command: 'git push heroku master',
options: {
failOnError: true,
stdout: true,
execOptions: { cwd: '../deploy'}
}
}但是,只有在进程进行时,我才能看到以下情况:
$ grunt push
Running "shell:git-push" (shell) task
Done, without errors.我希望在推送过程中看到推送的输出。
总之要这么做?
更新:完整的外壳脚本
shell: {
'git-add': {
command: 'git --no-pager add .',
options: {
stdout: true,
execOptions: { cwd: '../deploy'}
}
},
'git-commit': {
command: 'git --no-pager commit -m "update"',
options: {
stdout: true,
execOptions: { cwd: '../deploy'}
}
},
'git-push': {
command: 'git --no-pager push heroku master',
options: {
failOnError: true,
stdout: true,
execOptions: { cwd: '../deploy'}
}
}
}最终Grunt Shell (工作):
shell: {
'git-add': {
command: 'git --no-pager add .',
options: {
stdout: true,
stderr: true,
execOptions: { cwd: '../deploy'}
}
},
'git-commit': {
command: 'git --no-pager commit -m "update"',
options: {
stdout: true,
stderr: true,
execOptions: { cwd: '../deploy'}
}
},
'git-push': {
command: 'git --no-pager push heroku master',
options: {
failOnError: true,
stdout: true,
stderr: true,
execOptions: { cwd: '../deploy'}
}
}
}发布于 2014-02-20 23:16:15
请参见:
How to make git diff write to stdout?
添加--无寻呼机作为选项,提供输出。
git --no-pager <subcommand> <options>另外,某些git命令会写到stderr,如下所述:
http://git.661346.n2.nabble.com/git-push-output-goes-into-stderr-td6758028.html
通过在grunt任务中包含标志和捕获stderr,我能够为heroku推送过程的最后一部分(但不是跟踪上传的部分)获得输出:
Fetching repository, done.
-----> Node.js app detected
PRO TIP: Specify a node version in package.json
See https://devcenter.heroku.com/articles/nodejs-supporthttps://stackoverflow.com/questions/19526445
复制相似问题