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
*/
2017-05-10 09:37:48 +02:00
import Gulp from 'gulp';
2017-02-04 14:56:29 +01:00
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';
2017-05-10 09:37:48 +02:00
import Gulpif from 'gulp-if';
2017-02-04 14:56:29 +01:00
var argv = yrgv.argv;
2017-05-10 09:37:48 +02:00
Gulp.task('bump', (cb) => {
2017-02-04 14:56:29 +01:00
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);
}
);
});
2017-05-10 09:37:48 +02:00
Gulp.task('bump-pkg-version', () => {
return Gulp.src(['./package.json'])
2017-05-10 10:24:04 +02:00
.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' })))
2017-05-10 09:37:48 +02:00
.pipe(Gulp.dest('./'));
2017-02-04 14:56:29 +01:00
});