-
-
Notifications
You must be signed in to change notification settings - Fork 173
/
gulpfile.js
39 lines (34 loc) · 1.03 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
/**
* Delete ./crossnote directory
* Then copy files from
* - ./node_modules/crossnote/out/dependencies/. to ./crossnote/dependencies/
* - ./node_modules/crossnote/out/styles/. to ./crossnote/styles/
* - ./node_modules/crossnote/out/webview/. to ./crossnote/webview/
*/
const gulp = require('gulp');
const fs = require('fs');
gulp.task('clean-out', (cb) => {
// Delete ./out folder
if (fs.existsSync('./out')) {
fs.rmSync('./out', { recursive: true });
}
cb();
});
gulp.task('copy-files', (cb) => {
// Delete ./crossnote directory
if (fs.existsSync('./crossnote')) {
fs.rmSync('./crossnote', { recursive: true });
}
// Copy files
gulp
.src('./node_modules/crossnote/out/dependencies/**/*')
.pipe(gulp.dest('./crossnote/dependencies/'));
gulp
.src('./node_modules/crossnote/out/styles/**/*')
.pipe(gulp.dest('./crossnote/styles/'));
gulp
.src('./node_modules/crossnote/out/webview/**/*')
.pipe(gulp.dest('./crossnote/webview/'));
console.log('Copy files done.');
cb();
});