From 0aa2565df3c70a4206e5fdb90c554d227cd98796 Mon Sep 17 00:00:00 2001 From: GyDi Date: Wed, 16 Feb 2022 02:43:52 +0800 Subject: [PATCH] fix: spawn command --- src-tauri/src/cmds.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/cmds.rs b/src-tauri/src/cmds.rs index 81a0160..eeaabd5 100644 --- a/src-tauri/src/cmds.rs +++ b/src-tauri/src/cmds.rs @@ -174,7 +174,7 @@ pub fn view_profile(index: usize, profiles_state: State<'_, ProfilesState>) -> R // use vscode first if let Ok(code) = which::which("code") { - return match Command::new(code).arg(path).status() { + return match Command::new(code).arg(path).spawn() { Ok(_) => Ok(()), Err(_) => Err("failed to open file by VScode".into()), }; @@ -182,7 +182,7 @@ pub fn view_profile(index: usize, profiles_state: State<'_, ProfilesState>) -> R // use `open` command if let Ok(open) = which::which("open") { - return match Command::new(open).arg(path).status() { + return match Command::new(open).arg(path).spawn() { Ok(_) => Ok(()), Err(_) => Err("failed to open file by `open`".into()), };