stynx_code_config/application/platform.rs
1use std::path::PathBuf;
2
3pub fn home_dir() -> Option<PathBuf> {
4 std::env::var("HOME")
5 .or_else(|_| std::env::var("USERPROFILE"))
6 .ok()
7 .map(PathBuf::from)
8}
9
10pub fn shell_command() -> (&'static str, &'static str) {
11 if cfg!(windows) {
12 ("cmd.exe", "/C")
13 } else {
14 ("sh", "-c")
15 }
16}