X-Git-Url: http://git.euphorik.ch/?p=recipes.git;a=blobdiff_plain;f=backend%2Fbuild.rs;fp=backend%2Fbuild.rs;h=45ca9a5869b8ad3caf4d1a51be1278d27f2fb112;hp=9ae79dee296ec8a2703f7346968f6b88500ab320;hb=0a1631e66c861de2799cd98fc93686ff121c9fce;hpb=cbe276fc0601041b13087a6ffd80c5b126dfbe59
diff --git a/backend/build.rs b/backend/build.rs
index 9ae79de..45ca9a5 100644
--- a/backend/build.rs
+++ b/backend/build.rs
@@ -5,13 +5,21 @@ What is build here:
- Compile the SASS file to CSS file.
*/
-use std::{ env, process::{ Command, Output }, path::Path };
+use std::{
+ env,
+ path::Path,
+ process::{Command, Output},
+};
fn exists_in_path
(filename: P) -> bool
- where P: AsRef {
- for path in env::split_paths(&env::var_os("PATH").unwrap()) {
- if path.join(&filename).is_file() { return true; }
+where
+ P: AsRef,
+{
+ for path in env::split_paths(&env::var_os("PATH").unwrap()) {
+ if path.join(&filename).is_file() {
+ return true;
}
+ }
false
}
@@ -26,16 +34,16 @@ fn main() {
.expect("Unable to compile SASS file, install SASS, see https://sass-lang.com/")
}
- let output =
- if exists_in_path("sass.bat") {
- run_sass(Command::new("cmd").args(&["/C", "sass.bat"]))
- } else {
- run_sass(&mut Command::new("sass"))
- };
+ let output = if exists_in_path("sass.bat") {
+ run_sass(Command::new("cmd").args(&["/C", "sass.bat"]))
+ } else {
+ run_sass(&mut Command::new("sass"))
+ };
if !output.status.success() {
// SASS will put the error in the file.
- let error = std::fs::read_to_string("./static/style.css").expect("unable to read style.css");
+ let error =
+ std::fs::read_to_string("./static/style.css").expect("unable to read style.css");
panic!("{}", error);
}
-}
\ No newline at end of file
+}