forked from krausest/js-framework-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopy.js
25 lines (21 loc) · 1006 Bytes
/
copy.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
var _ = require('lodash');
var exec = require('child_process').execSync;
var fs = require('fs-extra');
var path = require('path');
if (fs.existsSync("dist")) fs.removeSync("dist");
fs.mkdirSync("dist");
fs.mkdirSync("dist"+path.sep+"webdriver-ts");
fs.copySync("webdriver-ts"+path.sep+"table.html", "dist"+path.sep+"webdriver-ts"+path.sep+"table.html");
fs.copySync("index.html", "dist"+path.sep+"index.html");
fs.copySync("css", "dist"+path.sep+"css");
_.each(fs.readdirSync('.'), function(name) {
if(fs.statSync(name).isDirectory() && name[0] !== '.' && name !== 'css' && name !== 'node_modules' && name !== 'webdriver-ts' && name !== 'dist') {
console.log("dist"+path.sep+name);
fs.mkdirSync("dist"+path.sep+name);
fs.mkdirSync("dist"+path.sep+name+path.sep+"dist");
fs.copySync(name+path.sep+"dist", "dist"+path.sep+name+path.sep+"dist");
if (fs.existsSync(name+path.sep+"index.html")) {
fs.copySync(name+path.sep+"index.html", "dist"+path.sep+name+path.sep+"index.html");
}
}
});