summary refs log tree commit diff
path: root/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..d9814cb
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,16 @@
+use std::process::Command;
+
+fn main() {
+    println!("cargo::rerun-if-changed=Cargo.toml");
+    let status = Command::new("bash")
+        .args(["-c", r#"
+            set -o pipefail
+            stylance . | sed "s/^\.\/\.\//cargo::rerun-if-changed=/"
+        "#])
+        .status()
+        .expect("Could not run stylance");
+
+    if !status.success() {
+        panic!("Stylance did not run successfully");
+    }
+}