forked from code4history/Maplat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
49 lines (44 loc) · 1.22 KB
/
gulpfile.js
File metadata and controls
49 lines (44 loc) · 1.22 KB
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
var gulp = require("gulp"),
fs = require("fs-extra"),
zip = require("gulp-zip");
gulp.task("zip", async () => {
try {
fs.removeSync("./distribution.zip");
} catch (e) { }
try {
fs.removeSync("./distribution");
} catch (e) { }
try {
fs.removeSync("./example.zip");
} catch (e) { }
try {
fs.removeSync("./example");
} catch (e) { }
fs.copySync("./dist/assets", "./distribution");
await new Promise((resolve, reject) => {
gulp
.src(["./distribution/**/*"])
.pipe(zip("distribution.zip"))
.on("error", reject)
.pipe(gulp.dest("./"))
.on("end", resolve);
});
fs.removeSync("./distribution");
fs.copySync("./dist", "./example");
fs.copySync("./apps", "./example/apps");
fs.copySync("./maps", "./example/maps");
fs.copySync("./pois", "./example/pois");
fs.copySync("./tiles", "./example/tiles");
fs.copySync("./img", "./example/img");
fs.copySync("./pwa", "./example/pwa");
fs.copySync("./tmbs", "./example/tmbs");
await new Promise((resolve, reject) => {
gulp
.src(["./example/**/*"])
.pipe(zip("example.zip"))
.on("error", reject)
.pipe(gulp.dest("./"))
.on("end", resolve);
});
fs.removeSync("./example");
});