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