-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGulpfile.js
43 lines (36 loc) · 1.08 KB
/
Gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// https://github.com/gulpjs/gulp/blob/master/docs/recipes/running-tasks-in-series.md
const gulp = require('gulp');
const bump = require('gulp-bump');
const zip = require('gulp-zip');
const fs = require('fs');
const path = require('path');
const rimraf = require('gulp-rimraf');
const svgstore = require('gulp-svgstore');
const rename = require('gulp-rename');
const cheerio = require('gulp-cheerio');
const getPackageJson = function () {
return JSON.parse(fs.readFileSync('./manifest.json', 'utf8'));
};
const extensionName = 'Asana Plus';
gulp.task('bump', () => gulp.src('./manifest.json')
.pipe(bump({ type: 'minor' }))
.pipe(gulp.dest('./')));
gulp.task('remove', cb => {
gulp.src(`./${extensionName}*.zip`, { read: false })
.pipe(rimraf());
cb();
});
gulp.task('zip', cb => {
gulp.src([
'./icons/**',
'./assets/**',
'./dist/**',
'./manifest.json',
], { base: '.' })
.pipe(zip(`${extensionName} ${getPackageJson().version.replace(/\./gi, '-')}.zip`))
.pipe(gulp.dest('./'));
cb();
});
gulp.task('default',
gulp.series('bump', 'remove', 'zip')
);