diff --git a/build.rs b/build.rs index ccb77d8..0a3ac9c 100644 --- a/build.rs +++ b/build.rs @@ -41,5 +41,12 @@ fn generate_completions() { fn main() { let version = git_version().unwrap_or_else(crate_version); println!("cargo:rustc-env=ZOXIDE_VERSION={}", version); + + // Since we are generating completions in the package directory, we need to + // set this so that Cargo doesn't rebuild every time. + println!("cargo:rerun-if-changed=src"); + println!("cargo:rerun-if-changed=templates"); + println!("cargo:rerun-if-changed=tests"); + generate_completions(); }