Skip to main content

Mountain/Binary/IPC/ProcessCommand/
process_get_platform.rs

1
2//! Tauri command - return the Wind/Node-style platform identifier
3//! (`darwin` / `win32` / `linux` / fallthrough). Mirrors
4//! `process.platform` so renderer code that branches on it works
5//! unchanged.
6
7#[tauri::command]
8pub async fn process_get_platform() -> Result<String, String> {
9	Ok(match std::env::consts::OS {
10		"macos" => "darwin",
11		"windows" => "win32",
12		"linux" => "linux",
13		Other => Other,
14	}
15	.to_string())
16}