aboutsummaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2020-10-02 00:48:16 +0000
committerGitHub <noreply@github.com>2020-10-02 00:48:16 +0000
commit39d7677f90d49af1b836f060787d8b357f36942d (patch)
treef8c76796852c7307c7e73ed26961a18d5e2cfb7c /build.rs
parentMerge pull request #384 from svenstaro/dependabot/cargo/chrono-0.4.19 (diff)
parentmore feedback (diff)
downloadminiserve-39d7677f90d49af1b836f060787d8b357f36942d.tar.gz
miniserve-39d7677f90d49af1b836f060787d8b357f36942d.zip
Merge pull request #380 from ahti/master
client-side color-scheme handling
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..8c354d0
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,19 @@
+use std::env;
+use std::fs;
+use std::path::Path;
+
+fn main() {
+ let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR env var missing");
+ let dest_path = Path::new(&out_dir).join("style.css");
+ fs::write(
+ &dest_path,
+ grass::from_string(
+ include_str!("data/style.scss").to_string(),
+ &grass::Options::default(),
+ )
+ .expect("scss failed to compile"),
+ )
+ .expect("failed to write css file");
+
+ println!("cargo:rerun-if-changed=data/style.scss");
+}