-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
44 lines (35 loc) · 959 Bytes
/
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
44
const gulp = require('gulp');
const { series } = require('gulp');
const zip = require('gulp-zip');
const fs = require('fs-extra');
const config = require('./build.config.json');
const destination = './dist/' + config.version;
const fileName = 'nowpass-' + config.version + '.zip';
// Simple deployment and packaging script
gulp.task('default', () => {
console.log('Use build')
});
gulp.task('clean', async () => {
console.log('Building ' + config.version);
try {
fs.removeSync(destination);
} catch (err) {
// Ignore
}
try {
fs.mkdirSync(destination);
} catch (err) {
// Ignore
}
return true;
});
gulp.task('copy', async () => {
return gulp.src('extension/**/*')
.pipe(gulp.dest(destination));
});
gulp.task('zip', async () => {
return gulp.src(destination + '/**')
.pipe(zip(fileName))
.pipe(gulp.dest('./dist'));
});
exports.build = series('zip');