代码拉取完成,页面将自动刷新
/**
* this is just for the release.
*/
'use strict';
var gulp = require('gulp');
var bump = require('gulp-bump');
var gulpReplace = require('gulp-replace');
var argv = require('yargs').argv;
var shell = require('gulp-shell');
var runSequence = require('run-sequence');
gulp.task('release' , function(cb)
{
runSequence('git:pull',
// 'build',
'bump:msg',
cb);
});
gulp.task('git:pull' , shell.task([
"git checkout gh-pages",
"git pull origin gh-pages"
]));
gulp.task('git:commit' , function()
{
var extraComment = argv.comment || '';
return gulp.src('./package.json', {read: true})
.pipe(shell([
"git add .",
"git commit -am 'release version: <%= getVersion(file) %> " + extraComment + "'",
"git push origin gh-pages",
"git checkout master",
"git pull origin gh-pages",
"git tag v<%= getVersion(file) %>",
"git push origin master --tags",
"git checkout gh-pages"
],{
templateData: {
getVersion: function(s)
{
var b = s.contents.toString('utf-8');
var json = JSON.parse(b);
return json.version;
}
}
}));
});
gulp.task('bump:msg' , function(cb)
{
runSequence('bump',
'git:commit',
cb);
});
gulp.task('bump' , function()
{
return gulp.src(
'./package.json'
).pipe(
bump()
).pipe(gulp.dest('./'));
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。