update
This commit is contained in:
1 parent
d4fdc9890a
commit
5787b14880
22 files changed
+5766
-710
No files matched your search
@@ -1,3 +1,13 @@
|
||||
pub mod clipboard;
|
||||
pub mod git;
|
||||
pub mod url;
|
||||
|
||||
/// Open a file, directory, or URL with the system default application.
|
||||
pub fn open_path(target: &str) {
|
||||
#[cfg(target_os = "macos")]
|
||||
let _ = std::process::Command::new("open").arg(target).spawn();
|
||||
#[cfg(target_os = "windows")]
|
||||
let _ = std::process::Command::new("cmd").args(["/c", "start", "", target]).spawn();
|
||||
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
|
||||
let _ = std::process::Command::new("xdg-open").arg(target).spawn();
|
||||
}
|
||||
Reference in new issue
Block a user