-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
38 lines (35 loc) · 1.19 KB
/
build.rs
File metadata and controls
38 lines (35 loc) · 1.19 KB
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
#[cfg(feature = "frontend")]
use std::process::Command;
fn main() {
#[cfg(feature = "frontend")]
{
println!("cargo::rerun-if-changed=frontend");
let mut install = Command::new("bun")
.arg("install")
.current_dir("./frontend")
.spawn()
.expect("failed to execute bun install");
let ecode = install.wait().expect("failed to wait on bun install");
assert!(ecode.success());
let mut build = Command::new("bun")
.args(["run", "build"])
.current_dir("./frontend")
.spawn()
.expect("failed to execute bun run build");
let ecode = build.wait().expect("failed to wait on bun run build");
assert!(ecode.success());
let mut tar = Command::new("tar")
.args([
"--create",
"--owner=0",
"--group=0",
"--file=../../frontend.tar",
".",
])
.current_dir("./frontend/dist")
.spawn()
.expect("failed to execute tar");
let ecode = tar.wait().expect("failed to wait on tar");
assert!(ecode.success());
}
}