From 6e1f8cdb3662d75d33021d0e43c853f3cb7f8134 Mon Sep 17 00:00:00 2001 From: Stuart Neivandt Date: Sat, 20 Jul 2024 21:57:51 -0700 Subject: [PATCH] build.rs create hooks dir if not exists (#283) --- build.rs | 3 +++ src/scheduler.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/build.rs b/build.rs index a26f4e9..42cf34d 100644 --- a/build.rs +++ b/build.rs @@ -8,6 +8,9 @@ fn main() -> Result<()> { // Copy hooks to appropriate location so that git will run them. // In git worktrees, .git is a symlink and the following commands fail. if Path::new(".git").is_dir() { + if !Path::new("./.git/hooks").exists() { + std::fs::create_dir_all("./.git/hooks")?; + } std::fs::copy("./scripts/pre-commit", "./.git/hooks/pre-commit")?; std::fs::copy("./scripts/pre-push", "./.git/hooks/pre-push")?; } diff --git a/src/scheduler.rs b/src/scheduler.rs index 2e515c3..b5469d9 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -386,6 +386,7 @@ pub struct Analyzer { } #[derive(Debug, Clone)] +#[allow(dead_code)] pub struct Schedule { #[allow(unused)] pub scopes: BTreeMap, Scope>,