vsc-material-theme/.gulp/tasks/bump.js

37 lines
964 B
JavaScript
Raw Normal View History

2017-02-04 14:56:29 +01:00
'use strict';
/*
* > Bump
*/
import gulp from 'gulp';
import runSequence from 'run-sequence';
import gutil from 'gulp-util';
2017-02-04 14:56:29 +01:00
import yrgv from 'yargs';
import bump from 'gulp-bump';
import gulpif from 'gulp-if';
var argv = yrgv.argv;
gulp.task('bump', (cb) => {
runSequence(
'bump-pkg-version',
(error) => {
if (error) {
console.log(gutil.colors.magenta.bold('[bump]'), gutil.colors.red.bold(' There was an issue bumping version:\n'), error.message);
2017-02-04 14:56:29 +01:00
} else {
2017-04-10 09:09:35 +02:00
console.log(gutil.colors.magenta.bold('\n[bump]'), gutil.colors.green.bold(' Finished successfully\n'));
2017-02-04 14:56:29 +01:00
}
cb(error);
}
);
});
gulp.task('bump-pkg-version', () => {
return gulp.src(['./package.json'])
.pipe(gulpif((Object.keys(argv).length === 2), bump()))
.pipe(gulpif(argv.patch, bump()))
.pipe(gulpif(argv.minor, bump({ type: 'minor' })))
.pipe(gulpif(argv.major, bump({ type: 'major' })))
.pipe(gulp.dest('./'));
});