Skip to content

Commit 55dc10d

Browse files
committed
fix: don't unnecessarily reject launchers on linux.
Previously it probably went through 5 launers assuming they don't work before falling back to `xdg-open` which is usually present. Now it will use the first launcher that it could invoke.
1 parent 8aa9bce commit 55dc10d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/unix.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ pub fn command<T: AsRef<OsStr>>(path: T) -> Command {
2121
for (command, args) in &open_handlers {
2222
let result = Command::new(command).status_without_output();
2323

24-
if let Ok(status) = result {
25-
if status.success() {
26-
let mut cmd = Command::new(command);
27-
cmd.args(*args);
28-
return cmd;
29-
};
24+
if let Ok(_) = result {
25+
let mut cmd = Command::new(command);
26+
cmd.args(*args);
27+
dbg!(&cmd);
28+
return cmd;
3029
};
3130
}
3231

33-
// fallback to xdg-open
32+
// fallback to xdg-open, even though we know it's probably not working at this point.
3433
let (command, args) = &open_handlers[0];
3534
let mut cmd = Command::new(command);
3635
cmd.args(*args);

0 commit comments

Comments
 (0)