有没有办法在 gulp.js 任务运行器中自定义 git 提交消息
Is there a way to customize git commit message in gulp.js task runner
我已将 gulp.js 实施到我当前的项目构建中,并且我正在使用 gulp-git。我试图弄清楚是否有一种方法可以让用户在终端中键入 'gulp commit' 命令后选择输入唯一的提交消息。这可能吗?
这是当前的 gulp 任务。
gulp.task('commit', function(){
gulp.src('./*', {buffer:false})
.pipe(git.commit('initial commit'));
});
我正在使用 gulp-git 包 https://github.com/stevelacy/gulp-git
查看 gulp-prompt
,这似乎是您要查找的内容:
https://www.npmjs.com/package/gulp-prompt
我还没有测试过这个,但是像这样的东西应该可以工作:
安装gulp-提示npm install gulp-prompt
然后编辑您的 gulp 任务。
gulp.task('commit', function(){
var message;
gulp.src('./*', {buffer:false})
.pipe(prompt.prompt({
type: 'input',
name: 'commit',
message: 'Please enter commit message...'
}, function(res){
message = res.commit;
}))
.pipe(git.commit(message));
});
我已将 gulp.js 实施到我当前的项目构建中,并且我正在使用 gulp-git。我试图弄清楚是否有一种方法可以让用户在终端中键入 'gulp commit' 命令后选择输入唯一的提交消息。这可能吗?
这是当前的 gulp 任务。
gulp.task('commit', function(){
gulp.src('./*', {buffer:false})
.pipe(git.commit('initial commit'));
});
我正在使用 gulp-git 包 https://github.com/stevelacy/gulp-git
查看 gulp-prompt
,这似乎是您要查找的内容:
https://www.npmjs.com/package/gulp-prompt
我还没有测试过这个,但是像这样的东西应该可以工作:
安装gulp-提示npm install gulp-prompt
然后编辑您的 gulp 任务。
gulp.task('commit', function(){
var message;
gulp.src('./*', {buffer:false})
.pipe(prompt.prompt({
type: 'input',
name: 'commit',
message: 'Please enter commit message...'
}, function(res){
message = res.commit;
}))
.pipe(git.commit(message));
});