-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-all.js
31 lines (26 loc) · 916 Bytes
/
build-all.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
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const path = require('path');
const fs = require('fs-extra');
const DOCS_FOLDER = 'docs';
(async () => {
try {
// const indexPath = path.join('src', 'index.js');
// build lib
let { stdout, stderr } = await exec(`npm run dist`);
// if (stderr) {
// console.log(stderr);
// }
// build site
await fs.emptyDir(DOCS_FOLDER); // empty the <docs> folder
// let { stdout: sout, stderr: serr } = await exec(`cd site && npm run build`);
// console.log(serr, sout);
// if (serr) {
// console.log(sout);
// }
// // copy the site <site/dist> in <docs>
// await fs.copy(path.join(__dirname, 'site', 'dist'), path.join(__dirname, DOCS_FOLDER));
} catch (err) {
console.error(err);
}
})();