
* Generate the themes on build * In debug builds, watch the theme sources. When they change, re-generate the themes and reload the current theme, removing the need for the `theme_selector::Reload` command. Co-authored-by: Keith Simmons <keith@zed.dev>
31 lines
821 B
Rust
31 lines
821 B
Rust
use std::process::Command;
|
|
|
|
fn main() {
|
|
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.14");
|
|
|
|
let output = Command::new("npm")
|
|
.current_dir("../../styles")
|
|
.args(["ci"])
|
|
.output()
|
|
.expect("failed to run npm");
|
|
if !output.status.success() {
|
|
panic!(
|
|
"failed to install theme dependencies {}",
|
|
String::from_utf8_lossy(&output.stderr)
|
|
);
|
|
}
|
|
|
|
let output = Command::new("npm")
|
|
.current_dir("../../styles")
|
|
.args(["run", "build-themes"])
|
|
.output()
|
|
.expect("failed to run npm");
|
|
if !output.status.success() {
|
|
panic!(
|
|
"build-themes script failed {}",
|
|
String::from_utf8_lossy(&output.stderr)
|
|
);
|
|
}
|
|
|
|
println!("cargo:rerun-if-changed=../../styles");
|
|
}
|