From 0617663b249f9ca488e5de652108b17d67fbaf45 Mon Sep 17 00:00:00 2001 From: Vika Date: Sat, 29 Jul 2023 21:59:56 +0300 Subject: Moved the entire Kittybox tree into the root --- build.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 build.rs (limited to 'build.rs') diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..05eca7a --- /dev/null +++ b/build.rs @@ -0,0 +1,30 @@ +use std::env; + +fn main() { + println!("cargo:rerun-if-changed=migrations"); + + let out_dir = env::var("OUT_DIR").unwrap(); + + println!("cargo:rerun-if-changed=companion-lite/"); + let companion_out = std::path::Path::new(&out_dir).join("companion"); + + if let Ok(exit) = std::process::Command::new("tsc") + .arg("--outDir") + .arg(companion_out.as_os_str()) + .current_dir("companion-lite") + .spawn() + .unwrap() + .wait() + { + if !exit.success() { + std::process::exit(exit.code().unwrap_or(1)) + } + } + let companion_in = std::path::Path::new("companion-lite"); + for file in ["index.html", "style.css"] { + std::fs::copy( + companion_in.join(file), + &companion_out.join(file) + ).unwrap(); + } +} -- cgit 1.4.1