tsafe-cli 1.0.27

Secrets runtime for developers — inject credentials into processes via exec, never into shell history or .env files
// build.rs — embeds the app icon into tsafe.exe on Windows.
// On non-Windows targets this is a no-op so cross-compile and CI still work.
fn main() {
    #[cfg(target_os = "windows")]
    {
        // RC resolves paths relative to OUT_DIR, not the crate root, so we
        // must use an absolute path derived from CARGO_MANIFEST_DIR.
        let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
        let icon_path = format!("{manifest_dir}/../../assets/tsafe.ico");

        let mut res = winres::WindowsResource::new();

        // Only embed the icon when it exists on disk.  During `cargo publish`
        // the crate is extracted to a temp directory where the workspace root
        // (and its assets/ folder) is not present, so we skip icon embedding
        // in that context rather than failing the build.
        if std::path::Path::new(&icon_path).exists() {
            res.set_icon(&icon_path);
        }

        res.set("ProductName", "tsafe");
        res.set(
            "FileDescription",
            "tsafe CLI — local secret and credential manager",
        );
        res.set("CompanyName", "ABS Infrastructure Engineering");
        res.set("LegalCopyright", "Ryan Tilcock");
        res.set_version_info(winres::VersionInfo::PRODUCTVERSION, 0x0001_0000_0000_0000);

        if let Err(e) = res.compile() {
            // Non-fatal: version info embedding failed (e.g. no RC toolchain).
            // The binary will still work; it just won't have embedded metadata.
            eprintln!("cargo:warning=Windows resource compile skipped: {e}");
        }
    }
}