-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
29 lines (24 loc) · 819 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
// Gulp and its plugins
import gulp from 'gulp';
import clean from 'gulp-clean';
import copy from 'gulp-copy';
import replace from 'gulp-string-replace';
import vinyl from 'gulp-vinyl-zip';
// Data
import statusCodes from './src/status-codes.js';
gulp.task('cleanup', () => gulp.src('./build', {read: false, allowEmpty: true})
.pipe(clean()),
);
gulp.task('copy', () => gulp.src('./src/**/*')
.pipe(copy('./build', {prefix: 1})),
);
gulp.task('build', gulp.series('cleanup', 'copy', () => gulp.src('./build/info.plist')
.pipe(replace('%status-codes%', () => JSON.stringify(statusCodes)))
.pipe(gulp.dest('build')),
));
gulp.task('zip', () =>
gulp.src('./build/**/*')
.pipe(vinyl.zip('http-status.alfredworkflow'))
.pipe(gulp.dest('dist')),
);
gulp.task('default', gulp.series('build', 'zip', 'cleanup'));