我正在尝试使用来自npm的吞咽模块推进到我的远程存储库。add & commit部分运行良好,但它在尝试执行远程推送时遇到流错误。
bump: function () {
var branch = argv.branch || 'development';
fs.readFile('./package.json', function (err, data) {
if (err) { return ; }
return gulp.src(['./package.json', './bower.json'])
.pipe(git.add())
.pipe(git.commit('chore(core): bump to ' + JSON.parse(data).version))
.pipe(git.push('origin', branch, function(err) {
if(err) throw (err);
}));
});
}堆栈跟踪:
C:\src\git\ig\node_modules\gulp-git\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:623 变量写=dest.write(块); ^ 未定义的函数不是写入(C:\src\git\ig\node_modules\gulp-git\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:623:24) at flow (C:\src\git\ig\node_modules\gulp-git\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:632:7) at DestroyableTransform.pipeOnReadable的函数(C:\src\git\ig\node_modules\gulp-git\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:664:5) at DestroyableTransform.emit (events.js:104:17) at emitReadable_ (C:\src\git\ig\node_modules\gulp-git\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:448:10) at emitReadable (C:\src\git\ig\node_ )modules\gulp-git\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:444:5) at readableAddChunk (C:\src\git\ig\node_modules\gulp-git\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:187:9) at DestroyableTransform.Readable.push (C:\src\git\ig\node_modules\gulp-git\node_modules\through2\node_modules\readable-(C:\src\git\ig\node_modules\gulp-git\node_modules\through2\node_modules\readable-stream\lib_stream_transform.js:145:32) at Array.forEach (原生)
我在运行git版本1.6.0。看上去是在1.7.0。也许升级路径会有所帮助,但是这似乎是命令的一个相当标准的用法,所以我认为这是我做错的事情。
发布于 2016-02-10 21:09:58
在stevelacy (项目管理)的帮助下,我能够让它处理这个代码更改:
.pipe(git.commit('chore(core): bump to ' + JSON.parse(data).version))
.on('end', function() {
git.push('origin', branch, function(err) {
if(err) throw (err);
});
});到目前为止,git push命令还不能从流中执行。
https://stackoverflow.com/questions/35323668
复制相似问题