mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:33:45 +08:00
fix: open file
This commit is contained in:
parent
189b17ad8f
commit
273cbf333e
@ -50,9 +50,13 @@ pub fn open_file(path: PathBuf) -> Result<()> {
|
|||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
{
|
{
|
||||||
use std::os::windows::process::CommandExt;
|
use std::os::windows::process::CommandExt;
|
||||||
command = command.creation_flags(0x08000000);
|
if let Err(err) = command.creation_flags(0x08000000).arg(&path).spawn() {
|
||||||
|
log::error!(target: "app", "failed to open with VScode `{err}`");
|
||||||
|
open::that(path)?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
if let Err(err) = command.arg(&path).spawn() {
|
if let Err(err) = command.arg(&path).spawn() {
|
||||||
log::error!(target: "app", "failed to open with VScode `{err}`");
|
log::error!(target: "app", "failed to open with VScode `{err}`");
|
||||||
open::that(path)?;
|
open::that(path)?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user