Skip to content

Commit

Permalink
fix(linux): fix command detection (#174)
Browse files Browse the repository at this point in the history
closes #167
  • Loading branch information
amrbashir authored Jun 6, 2023
1 parent 4f3e4d7 commit 43b2a3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/linux-bin-detect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-mobile": "patch"
---

On Linux, fix crash after false detection of VSCode.
2 changes: 1 addition & 1 deletion src/os/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::process::Output> {
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 {
Expand Down

0 comments on commit 43b2a3b

Please sign in to comment.