]> git.proxmox.com Git - rustc.git/blob - src/vendor/mdbook/build.rs
New upstream version 1.19.0+dfsg1
[rustc.git] / src / vendor / mdbook / build.rs
1 // build.rs
2
3 use std::process::Command;
4 use std::env;
5 use std::path::Path;
6
7 fn main() {
8
9 if let Ok(_) = env::var("CARGO_FEATURE_REGENERATE_CSS") {
10
11 // Compile stylus stylesheet to css
12 let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
13
14 let theme_dir = Path::new(&manifest_dir).join("src/theme/");
15 let stylus_dir = theme_dir.join("stylus/book.styl");
16
17 if !Command::new("stylus")
18 .arg(format!("{}", stylus_dir.to_str().unwrap()))
19 .arg("--out")
20 .arg(format!("{}", theme_dir.to_str().unwrap()))
21 .arg("--use")
22 .arg("nib")
23 .status().unwrap()
24 .success() {
25 panic!("Stylus encoutered an error");
26 }
27 }
28
29 }