Mercurial > core / rust/lib/tenex/src/util.rs
changeset 698: |
96958d3eb5b0 |
parent: |
35ec32058823
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
1 /// OS-specific browser command. supports Win/Mac/Linux 2 pub fn open_browser(url: &str) { 3 if cfg!(target_os = "windows") { 4 // https://stackoverflow.com/a/49115945 5 std::process::Command::new("rundll32.exe") 6 .args(&["url.dll,FileProtocolHandler", url]) 8 .expect("failed to open file"); 9 } else if cfg!(target_os = "macos") || cfg!(target_os = "linux") { 10 // https://dwheeler.com/essays/open-files-urls.html 11 #[cfg(target_os = "macos")] 13 #[cfg(target_os = "linux")] 16 #[cfg(any(target_os = "macos", target_os = "linux"))] 18 std::process::Command::new(cmd) 21 .expect("failed to open URL"); 24 unimplemented!() // ignore others