Skip to main content

Mountain/Binary/IPC/ProcessCommand/
process_get_platform.rs

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