pub fn platform() -> Option<&'static str> {
if cfg!(all(target_os = "linux", target_arch = "x86_64")) {
Some("linux-x64")
} else if cfg!(all(target_os = "linux", target_arch = "aarch64")) {
Some("linux-arm64")
} else if cfg!(all(target_os = "macos", target_arch = "x86_64")) {
Some("macos-x64")
} else if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
Some("macos-arm64")
} else if cfg!(all(target_os = "windows", target_arch = "x86_64")) {
Some("windows-x64")
} else {
None
}
}
pub fn binary_asset_name(version: &str) -> Option<String> {
let platform = platform()?;
let ext = if cfg!(target_os = "windows") {
".exe"
} else {
""
};
Some(format!("kimun-{version}-{platform}{ext}"))
}