From c35a55babd9aa6e1ad8797f3d54deec2f78ff78a Mon Sep 17 00:00:00 2001 From: Vika Date: Wed, 28 Sep 2022 23:13:02 +0300 Subject: Switch to TypeScript This neccesitates installing TypeScript to build Kittybox, but thankfully Nix actually takes care of that. Build Kittybox with Nix and you won't have problems. Also now I can safely do stuff. --- kittybox-rs/build.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 kittybox-rs/build.rs (limited to 'kittybox-rs/build.rs') diff --git a/kittybox-rs/build.rs b/kittybox-rs/build.rs new file mode 100644 index 0000000..c9d6bfe --- /dev/null +++ b/kittybox-rs/build.rs @@ -0,0 +1,19 @@ +fn main() { + use std::env; + let out_dir = env::var("OUT_DIR").unwrap(); + println!("cargo:rerun-if-changed=javascript/"); + eprintln!("Out dir: {out_dir}"); + + let mut child = std::process::Command::new("tsc") + .arg("--outDir") + .arg(out_dir) + .current_dir("javascript") + .spawn() + .unwrap(); + + if let Ok(exit) = child.wait() { + if !exit.success() { + std::process::exit(exit.code().unwrap_or(1)) + } + } +} -- cgit 1.4.1