-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathbuild.rs
30 lines (27 loc) · 982 Bytes
/
build.rs
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
use std::process::Command;
fn main() {
// We want to let people install WinterJS from source, so we can't have
// a dependency on TSC at all times. The assumption here is that whoever
// updates TS sources for builtin modules will at least run WinterJS
// once in debug mode, and the JS scripts will be updated and pushed.
let profile = std::env::var("PROFILE").unwrap();
if profile == "debug" {
let builtins_dir = std::env::current_dir().unwrap().join("src/builtins");
let dir = builtins_dir.join("internal_js_modules");
assert!(Command::new("npx")
.arg("tsc")
.current_dir(dir)
.output()
.unwrap()
.status
.success());
let dir = builtins_dir.join("js_globals");
assert!(Command::new("npx")
.arg("tsc")
.current_dir(dir)
.output()
.unwrap()
.status
.success());
}
}