From 3da6c6393efb1fc8449cbf836570492b4e883f64 Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Fri, 6 Jul 2018 22:33:12 +0200 Subject: [PATCH] fix(doc): Don't rebuild gluon_doc when used outside of the gluon repo --- doc/build.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/build.rs b/doc/build.rs index 4dd59fd0b0..29f1b44a07 100644 --- a/doc/build.rs +++ b/doc/build.rs @@ -1,4 +1,5 @@ use std::env; +use std::path::Path; use std::process::Command; fn main() { @@ -10,6 +11,9 @@ fn main() { let git_hash = String::from_utf8(output.stdout).unwrap(); println!("cargo:rustc-env=GIT_HASH={}", git_hash); } - // This is the closest thing to making sure we rebuild this every time a new commit is made - println!("cargo:rerun-if-changed=../.git/COMMIT_EDITMSG"); + let git_edit_msg = "../.git/COMMIT_EDITMSG"; + if Path::new(git_edit_msg).exists() { + // This is the closest thing to making sure we rebuild this every time a new commit is made + println!("cargo:rerun-if-changed={}", git_edit_msg); + } }