首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gulp git:使用push会导致流错误。

gulp git:使用push会导致流错误。
EN

Stack Overflow用户
提问于 2016-02-10 18:58:52
回答 1查看 427关注 0票数 2

我正在尝试使用来自npm的吞咽模块推进到我的远程存储库。add & commit部分运行良好,但它在尝试执行远程推送时遇到流错误。

代码语言:javascript
复制
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。也许升级路径会有所帮助,但是这似乎是命令的一个相当标准的用法,所以我认为这是我做错的事情。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-10 21:09:58

stevelacy (项目管理)的帮助下,我能够让它处理这个代码更改:

代码语言:javascript
复制
.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命令还不能从流中执行。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35323668

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档