forked from eez-open/dashboard-standalone-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postinstall.js
38 lines (34 loc) · 1.05 KB
/
postinstall.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
const fs = require("fs");
const fse = require("fs-extra");
const FOLDERS = ["packages", "libs", "resources"];
// packages
fs.readdirSync("packages").forEach(folder => {
if (folder != "standalone" && fs.existsSync(`packages/${folder}`)) {
console.log(`Remove packages/${folder} ...`);
fse.removeSync(`packages/${folder}`);
}
});
fs.readdirSync("node_modules/eez-studio/packages").forEach(folder => {
// libs
console.log(
`Copy node_modules/eez-studio/packages/${folder} to packages/${folder} ...`
);
fse.copySync(
`node_modules/eez-studio/packages/${folder}`,
`packages/${folder}`
);
});
// libs
console.log(`Copy node_modules/eez-studio/libs to libs ...`);
try {
fse.removeSync("libs");
} catch (err) {}
fse.copySync("node_modules/eez-studio/libs", `libs`);
// resources
console.log(
`Copy node_modules/eez-studio/resources/expression-grammar.pegjs to resources ...`
);
fse.copySync(
"node_modules/eez-studio/resources/expression-grammar.pegjs",
`resources/expression-grammar.pegjs`
);