summaryrefslogtreecommitdiffstats
path: root/src/browser_states.rs
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2019-12-17 16:28:06 +0100
committerCanop <cano.petrole@gmail.com>2019-12-17 16:28:06 +0100
commitdcfa01906e72980ab7a77c627309336e18eb5b47 (patch)
treea0807c2d77d0406a9aa9f7c2cc904e7c0d76aa0f /src/browser_states.rs
parent14426cab944ca42d39608121d5fb0719fe9c6a7c (diff)
replace the "opener" crate with the "open" one
The opener crate panics when I try to open files on a server. The open crate just does nothing. It's cleaner.
Diffstat (limited to 'src/browser_states.rs')
-rw-r--r--src/browser_states.rs17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/browser_states.rs b/src/browser_states.rs
index cee92c6..50c671c 100644
--- a/src/browser_states.rs
+++ b/src/browser_states.rs
@@ -5,7 +5,7 @@ use std::{
time::Instant,
};
-use opener;
+use open;
use minimad::Composite;
use crate::{
@@ -101,8 +101,17 @@ impl BrowserState {
let tl = TaskLifetime::unlimited();
match &line.line_type {
LineType::File => {
- opener::open(&line.path)?;
- Ok(AppStateCmdResult::Keep)
+ match open::that(&line.path) {
+ Ok(exit_status) => {
+ info!("open returned with exit_status {:?}", exit_status);
+ Ok(AppStateCmdResult::Keep)
+ }
+ Err(e) => {
+ Ok(AppStateCmdResult::DisplayError(
+ format!("{:?}", e)
+ ))
+ }
+ }
}
LineType::Dir | LineType::SymLinkToDir(_) => {
let mut target = line.target();
@@ -120,7 +129,7 @@ impl BrowserState {
}
LineType::SymLinkToFile(target) => {
let path = PathBuf::from(target);
- opener::open(&path)?;
+ open::that(&path)?;
Ok(AppStateCmdResult::Keep)
}
_ => {