feat: add TeamSpeak address resolver

This commit is contained in:
Edison Jwa
2026-05-25 01:12:50 +09:00
parent d7556cd39f
commit eb9014cd81
15 changed files with 2360 additions and 314 deletions
+25
View File
@@ -0,0 +1,25 @@
use std::{env, process::Command};
fn main() {
println!("cargo:rerun-if-changed=.git/HEAD");
println!("cargo:rerun-if-changed=build.rs");
let version = env::var("CARGO_PKG_VERSION").unwrap_or_else(|_| "development".to_string());
let commit = git_output(&["rev-parse", "--short", "HEAD"]).unwrap_or_else(|| "unknown".into());
let date =
git_output(&["show", "-s", "--format=%cI", "HEAD"]).unwrap_or_else(|| "unknown".into());
println!("cargo:rustc-env=CHANORA_RESOLVER_BUILD_VERSION={version}");
println!("cargo:rustc-env=CHANORA_RESOLVER_BUILD_COMMIT={commit}");
println!("cargo:rustc-env=CHANORA_RESOLVER_BUILD_DATE={date}");
}
fn git_output(args: &[&str]) -> Option<String> {
let output = Command::new("git").args(args).output().ok()?;
if !output.status.success() {
return None;
}
let value = String::from_utf8(output.stdout).ok()?;
Some(value.trim().to_owned())
}