X-Git-Url: http://git.euphorik.ch/?p=rup.git;a=blobdiff_plain;f=backend%2Fbuild.rs;fp=backend%2Fbuild.rs;h=ba5da7efc0be95a6abfc02e2ff63202a89aefcab;hp=0000000000000000000000000000000000000000;hb=a44ff4555b6f08fce20f95ab4fae370012caa0aa;hpb=4a1fa0b902bd01c2630b8b7b0818e46142d93f94 diff --git a/backend/build.rs b/backend/build.rs new file mode 100644 index 0000000..ba5da7e --- /dev/null +++ b/backend/build.rs @@ -0,0 +1,25 @@ +/* +Additionnal build, doc: https://doc.rust-lang.org/cargo/reference/build-scripts.html + +What is build here: + - Compile the SASS file to CSS file. +*/ + +use std::process::Command; + +fn main() { + println!("cargo:rerun-if-changed=style.scss"); + + let output = + Command::new("sass") + .arg("./style.scss") + .arg("./static/style.css") + .output() + .expect("Unable to compile SASS file, install SASS, see https://sass-lang.com/"); + + if !output.status.success() { + //panic!("Unable to compile SASS file, install SASS, see https://sass-lang.com/") + let error = std::fs::read_to_string("./static/style.css").expect("unable to read style.css"); + panic!(error); + } +}