-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
32 lines (25 loc) · 852 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
31
32
use std::process::Command;
fn main() {
let mut build_date = build_data::format_date(build_data::now());
if build_date.ends_with('Z') {
build_date.pop();
}
let npm_commands = vec![
vec!["install"],
vec!["run", "build-tailwind"],
vec!["run", "build-highlight"],
vec!["run", "copy-highlight"],
];
for npm_command in &npm_commands {
let status = Command::new("npm")
.args(npm_command)
.status()
.unwrap_or_else(|_| panic!("failed to run npm command: {:?}", npm_command));
if !status.success() {
panic!("failed to run npm command: {:?}", npm_command);
}
}
println!("cargo:rerun-if-changed=templates");
println!("cargo:rustc-env=CARGO_BUILD_DATE={}", build_date);
build_data::no_debug_rebuilds();
}