forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeps.js
32 lines (29 loc) · 728 Bytes
/
deps.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
#!/usr/bin/node
//@ts-check
var fs = require("fs");
var path = require("path");
var content = fs.readFileSync(
path.join(__dirname, "..", "lib", "4.06.1", "unstable", "bspack.ml.d"),
"utf8"
);
var files = content
.split("\n")
.filter(Boolean)
.map(x =>
x
.split(":")
.map(x => x.trim())
.filter(Boolean)
.at(-1)
);
for (let file of files) {
let { base, dir } = path.parse(file);
// console.log(base, dir);
if (dir.includes("ml") && !base.includes("rescript")) {
continue;
}
let src = path.join(__dirname, "..", "jscomp", file);
let dest = path.join(__dirname, "..", "..", "rescript-pack", base);
console.log(`copy ${src} -> ${dest}`);
fs.copyFileSync(src, dest);
}