nooshdaroo 0.2.2

Protocol Shape-Shifting SOCKS Proxy - Dynamic protocol emulation for encrypted proxy traffic
Documentation
use std::process::Command;

fn main() {
    // Set build date
    let date = chrono::Utc::now().format("%Y-%m-%d %H:%M:%S UTC").to_string();
    println!("cargo:rustc-env=BUILD_DATE={}", date);

    // Try to get git hash, use "unknown" if git is not available
    let git_hash = Command::new("git")
        .args(&["rev-parse", "--short", "HEAD"])
        .output()
        .ok()
        .and_then(|output| {
            if output.status.success() {
                String::from_utf8(output.stdout).ok()
            } else {
                None
            }
        })
        .map(|s| s.trim().to_string())
        .unwrap_or_else(|| "unknown".to_string());

    println!("cargo:rustc-env=GIT_HASH={}", git_hash);

    // Rerun build script if git changes
    println!("cargo:rerun-if-changed=.git/HEAD");
}