Skip to content

Commit 1f67d00

Browse files
committed
gulp task git
1 parent 8dad765 commit 1f67d00

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

gulpfile.js

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -202,41 +202,16 @@ gulp.task('watch', function () {
202202

203203
gulp.task('default', ['build', 'test'])
204204

205-
var argv = require('yargs').argv
206-
var versioning = function () {
207-
if (argv.minor) {
208-
return 'minor'
209-
}
210-
if (argv.major) {
211-
return 'major'
212-
}
213-
return 'patch'
214-
}
215-
var bump = require('gulp-bump')
216-
gulp.task('version', function () {
217-
return gulp.src('./package.json')
218-
.pipe(bump({type: versioning()}))
219-
.pipe(gulp.dest('./'))
220-
})
221-
222-
gulp.task('post-build', ['version'], function (done) {
223-
gulp.start('build').on('task_stop', function (e) {
224-
if (e.task === 'build') {
225-
done()
226-
}
227-
})
228-
})
229-
230205
var git = require('gulp-git')
231206
var tag_version = require('gulp-tag-version')
232-
gulp.task('git', ['post-build'], function (done) {
207+
gulp.task('git', ['build'], function (done) {
233208
var v = require('./package.json').version
234209
gulp.src('./')
235210
.pipe(git.add({args: '-A'}))
236211
.pipe(git.commit('[release] ' + v))
237212
.pipe(tag_version({version: v}))
238213
.on('end', function () {
239-
// git.push('origin', 'master', {args: '--tags'})
214+
git.push('origin', 'master', {args: '--tags'})
240215
done()
241216
})
242217
})

0 commit comments

Comments
 (0)