Lot of thing
[recipes.git] / backend / build.rs
1 /*
2 Additionnal build, doc: https://doc.rust-lang.org/cargo/reference/build-scripts.html
3
4 What is build here:
5 - Compile the SASS file to CSS file.
6 */
7
8 use std::process::Command;
9
10 fn main() {
11 println!("cargo:rerun-if-changed=style.scss");
12
13 let output =
14 Command::new("sass")
15 .arg("./style.scss")
16 .arg("./static/style.css")
17 .output()
18 .expect("Unable to compile SASS file, install SASS, see https://sass-lang.com/");
19
20 if !output.status.success() {
21 //panic!("Unable to compile SASS file, install SASS, see https://sass-lang.com/")
22 let error = std::fs::read_to_string("./static/style.css").expect("unable to read style.css");
23 panic!(error);
24 }
25 }