-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
59 lines (50 loc) · 1.09 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const gulp = require('gulp');
const zip = require('gulp-zip');
const markdownPDF = require('gulp-markdown-pdf');
const del = require('del');
const path = require('path');
const { exec } = require('gulp-execa');
const { series } = gulp;
const cssPath = path.join(__dirname, 'css.css');
function runTest(cb) {
return exec('jest');
}
function makePDF(cb) {
return gulp
.src('*.md')
.pipe(
markdownPDF({
cssPath: cssPath,
paperBorder: '0px',
paperFormat: 'A4',
})
)
.pipe(gulp.dest('temp'));
}
function zipUserContent(cb) {
return gulp
.src('user-submitted-content/*')
.pipe(zip('TMO - User Submitted Content.zip'))
.pipe(gulp.dest('out'));
}
function zipModlist(cb) {
return gulp
.src('temp/*')
.pipe(gulp.src('in/*', { allowEmpty: true }))
.pipe(zip('TMO.zip'))
.pipe(gulp.dest('out'));
}
function cleanOutput(cb) {
return del('out');
}
function cleanTemp(cb) {
return del('temp');
}
exports.testPDF = series(makePDF);
exports.build = series(
cleanOutput,
zipUserContent,
makePDF,
zipModlist,
cleanTemp
);