Skip to content

Commit 0a39f05

Browse files
committed
update gulp build
1 parent 6b7c1f8 commit 0a39f05

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

gulpfile.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
var gulp = require('gulp'),
2+
replace = require('gulp-replace'),
3+
bump = require("gulp-bump"),
24
rename = require("gulp-rename"),
35
del = require('del'),
46
css = require('gulp-clean-css');
@@ -24,6 +26,34 @@ gulp.task('js', ['clean'], function () {
2426
.pipe(gulp.dest('./dist/js/'));
2527
});
2628

29+
gulp.task('bump', ['bump-js', 'bump-css'], function(){
30+
return gulp.src(['./bower.json', './package.json', './src/stable.tableexport.js'])
31+
.pipe(bump())
32+
.pipe(gulp.dest('./'));
33+
});
34+
35+
gulp.task('bump-js', function () {
36+
return gulp.src(['src/stable/js/tableexport.js'])
37+
.pipe(replace(/(v\d\.\d\.)(\d)/g, function (matches, match1, match2) {
38+
return match1 + (Number(match2)+1);
39+
}))
40+
.pipe(gulp.dest('src/stable/js/'))
41+
.on('end', function () {
42+
gulp.start('js');
43+
});
44+
});
45+
46+
gulp.task('bump-css', function () {
47+
gulp.src(['src/stable/css/tableexport.css'])
48+
.pipe(replace(/(v\d\.\d\.)(\d)/g, function (matches, match1, match2) {
49+
return match1 + (Number(match2) + 1);
50+
}))
51+
.pipe(gulp.dest('src/stable/css/'))
52+
.on('end', function () {
53+
gulp.start('css');
54+
});
55+
});
56+
2757
gulp.task('clean', function () {
2858
return del(['dist/js']);
2959
});

0 commit comments

Comments
 (0)