forked from coveo/search-ui-seed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.js
36 lines (31 loc) · 889 Bytes
/
setup.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
'use strict';
const fs = require('fs');
const ncp = require('ncp').ncp;
const directoriesToCreate = [
"./bin",
"./bin/css",
"./bin/image",
"./bin/js",
"./bin/templates"
]
const filesToCopy = [{
"src":'./node_modules/coveo-search-ui/bin/css/CoveoFullSearch.css',
"dest":'./bin/css/CoveoFullSearch.css'
}];
const folderToCopy = [{
"src": "./node_modules/coveo-search-ui/bin/js",
"dest" : "./bin/js"
},{
"src":'./node_modules/coveo-search-ui/bin/image',
"dest":'./bin/image'
},{
"src":'./templates',
"dest":'./bin/templates'
},{
"src":'./pages',
"dest":'./bin'
}];
directoriesToCreate.filter(directory => !fs.existsSync(directory))
.forEach(directory => fs.mkdirSync(directory));
filesToCopy.forEach(file => fs.createReadStream(file.src).pipe(fs.createWriteStream(file.dest)))
folderToCopy.forEach(folder => ncp(folder.src, folder.dest));