-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
109 lines (95 loc) · 2.3 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
const gulp = require("gulp");
const debug = require("gulp-debug");
const exec = require("child_process").exec;
const livereload = require("gulp-livereload");
var downloader = require('github-download-directory');
function installAtomicBeta(cb) {
exec("npm i @coveo/atomic@beta", function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
}
function installAtomicAlpha(cb) {
exec("npm i @coveo/atomic@alpha", function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
}
function installAtomicLatest(cb) {
exec("npm i @coveo/atomic@latest", function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
}
function getTestPages() {
return downloader.download('coveo', 'ui-kit', 'packages/atomic/src/pages').then(console.log, console.error);
}
function moveDownloadedFiles() {
return gulp
.src(["./packages/atomic/src/pages/**/*"])
.pipe(gulp.dest("./public/pages/"))
.pipe(debug())
}
function deleteOriginalFiles() {
return exec("rm -rfv ./packages", function (_, stdout, stderr) {
console.log(stdout);
console.log(stderr);
});
}
function copyResource() {
return gulp
.src(["./node_modules/@coveo/atomic/dist/atomic/**/*"])
.pipe(gulp.dest("./public/build/"))
.pipe(debug());
}
function copyLocalTestFiles() {
return gulp
.src(["./testPages/**/*"])
.pipe(gulp.dest("./public"))
.pipe(debug());
}
function copyExtraResources() {
return gulp
.src(["./resources/**/*"])
.pipe(gulp.dest("./public/build/assets"))
.pipe(debug());
}
function copyThemes() {
return gulp
.src(["./public/build/themes/**/*"])
.pipe(gulp.dest("./public/themes"))
.pipe(debug());
}
exports.alpha = gulp.series(
installAtomicAlpha,
copyResource,
copyExtraResources,
copyThemes,
// getTestPages,
// moveDownloadedFiles,
// deleteOriginalFiles,
copyLocalTestFiles
);
exports.beta = gulp.series(
installAtomicBeta,
copyResource,
copyExtraResources,
copyThemes,
getTestPages,
moveDownloadedFiles,
deleteOriginalFiles,
copyLocalTestFiles,
);
exports.latest = gulp.series(
installAtomicLatest,
copyResource,
copyExtraResources,
copyThemes,
getTestPages,
moveDownloadedFiles,
deleteOriginalFiles,
copyLocalTestFiles
);