Skip to content

Commit 0fdf646

Browse files
committed
Use command -v instead of which to detect command availability
1 parent 24b5647 commit 0fdf646

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

crates/frontend/src/pages/instance/settings_subpage.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
use std::{borrow::Cow, cmp::Ordering, path::Path, sync::Arc};
2-
#[cfg(target_os = "linux")]
3-
use std::process::Command;
42

53
use bridge::{
64
handle::BackendHandle, instance::InstanceID, message::MessageToBackend, meta::MetadataRequest
@@ -431,8 +429,9 @@ impl InstanceSettingsSubpage {
431429

432430
#[cfg(target_os = "linux")]
433431
fn is_command_available(command: &str) -> bool {
434-
Command::new("which")
435-
.arg(command)
432+
std::process::Command::new("sh")
433+
.arg("-c")
434+
.arg(format!("command -v {command}"))
436435
.output()
437436
.map(|output| output.status.success())
438437
.unwrap_or(false)

0 commit comments

Comments
 (0)