fix: spawn command

This commit is contained in:
GyDi 2022-02-16 02:43:52 +08:00
parent 22b11db16e
commit 0aa2565df3
No known key found for this signature in database
GPG Key ID: 1C95E0D3467B3084

View File

@ -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()),
};