From 43b2a3ba3a05b9ca3d3c9d8d7eafbeb4f24bf396 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Tue, 6 Jun 2023 19:37:30 +0300 Subject: [PATCH] fix(linux): fix command detection (#174) closes #167 --- .changes/linux-bin-detect.md | 5 +++++ src/os/linux/mod.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/linux-bin-detect.md diff --git a/.changes/linux-bin-detect.md b/.changes/linux-bin-detect.md new file mode 100644 index 00000000..afa1b90c --- /dev/null +++ b/.changes/linux-bin-detect.md @@ -0,0 +1,5 @@ +--- +"tauri-mobile": "patch" +--- + +On Linux, fix crash after false detection of VSCode. diff --git a/src/os/linux/mod.rs b/src/os/linux/mod.rs index 22df613b..fe0c87a7 100644 --- a/src/os/linux/mod.rs +++ b/src/os/linux/mod.rs @@ -164,7 +164,7 @@ pub fn open_file_with( // Linux does not require a binary "command" in path, so this seems the way to go. #[cfg(target_os = "linux")] pub fn command_path(name: &str) -> std::io::Result { - duct::cmd("sh", ["-c", "command", "-v", name]).run() + duct::cmd("sh", ["-c", format!("command -v {name}").as_str()]).run() } pub fn code_command() -> duct::Expression {