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