Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Removed sys dep sass
Browse files Browse the repository at this point in the history
  • Loading branch information
alexislozano committed Aug 14, 2019
1 parent 715d982 commit 501d9b4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .gitignore
@@ -1,4 +1,3 @@
/target
**/*.rs.bk
Cargo.lock
.sass-cache
Cargo.lock
5 changes: 4 additions & 1 deletion Cargo.toml
Expand Up @@ -12,4 +12,7 @@ license = "MIT"
web-view = "0.4.1"
serde = { version = "1.0.98", features = ["derive"] }
serde_json = "1.0.40"
strfmt = "0.1.6"
strfmt = "0.1.6"

[build-dependencies]
rsass = "0.11.0"
36 changes: 19 additions & 17 deletions build.rs
@@ -1,26 +1,28 @@
use std::env;
use std::process::Command;
use rsass::{compile_scss_file, OutputStyle};
use std::fs;

fn main() {
let out_dir = env::var("OUT_DIR").unwrap();

// Theming commons
Command::new("sass")
.args(&[
"--no-cache",
"src/www/app.scss",
&format!("{}/app.css", out_dir),
])
.status()
.unwrap();
compile_write(
"src/www/app.scss",
&format!("{}/app.css", out_dir)
);

// Breeze theme
Command::new("sass")
.args(&[
"--no-cache",
"src/www/breeze.scss",
&format!("{}/breeze.css", out_dir),
])
.status()
.unwrap();
compile_write(
"src/www/breeze.scss",
&format!("{}/breeze.css", out_dir)
);
}

fn compile_write(path: &str, out: &str) {
let css = compile_scss_file(
path.as_ref(),
OutputStyle::Compressed
).unwrap();

fs::write(out, css).unwrap();
}

0 comments on commit 501d9b4

Please sign in to comment.