X-Git-Url: http://git.euphorik.ch/?p=recipes.git;a=blobdiff_plain;f=backend%2Fbuild.rs;h=48175fa0364ed6d824561d63c59ad4ab4a7ce58c;hp=c5f9e2e84f20db5f55a484bea6944f3c65283148;hb=e2e54b8f43015738af860b005825dc809f5275ab;hpb=3ebbe8172b0430bae5c554925a4582c9fec545f3 diff --git a/backend/build.rs b/backend/build.rs index c5f9e2e..48175fa 100644 --- a/backend/build.rs +++ b/backend/build.rs @@ -1,11 +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"); - Command::new("sass") - .arg("./style.scss") - .arg("./static/style.css") - .output() - .expect("Unable to compile SASS file, install SASS, see https://sass-lang.com/"); + 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); + } } \ No newline at end of file