wecom-cli 0.1.5

The official CLI for WeCom — 企业微信命令行工具,让人类和 AI Agent 都能在终端中操作企业微信
use std::path::Path;
use std::process::Command;

fn main() {
    let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
    let git_dir = Path::new(&manifest_dir).join(".git");

    // Set up git hooks
    if git_dir.exists() {
        let status = Command::new("git")
            .args(["config", "core.hooksPath", ".githooks"])
            .current_dir(&manifest_dir)
            .status();

        match status {
            Ok(s) if !s.success() => {
                println!(
                    "cargo:warning=⚠️ Failed to set core.hooksPath. Run `git config core.hooksPath .githooks` manually."
                );
            }
            Err(e) => {
                println!(
                    "cargo:warning=⚠️ Failed to run git: {e}. Run `git config core.hooksPath .githooks` manually."
                );
            }
            _ => {}
        }
    }

    println!("cargo:rerun-if-changed=.githooks");
}