Skip to content

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
willcrichton committed Jun 23, 2022
1 parent 5a395ec commit 5cfa431
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use std::{path::Path, process::Command};

const JS_DIST_DIR: &str = "js/dist";

fn main() {
if !Path::new(JS_DIST_DIR).exists() {
let status = Command::new("pnpm")
.current_dir("js")
.arg("install")
.status()
.unwrap();
if !status.success() {
panic!("Failed to install JS deps")
}

let status = Command::new("pnpm")
.current_dir("js")
.arg("build")
.status()
.unwrap();
if !status.success() {
panic!("Failed to build JS");
}

return;
}
}

0 comments on commit 5cfa431

Please sign in to comment.