open errors

pull/6/head
dvkt 5 years ago
parent 8f467fea56
commit 3ee60b1fee

@ -52,7 +52,6 @@ Just unzip/untar the `phetch` program into your $PATH and get going!
## todo
- [ ] redo history view
- [ ] new screenshots
- [ ] little GIF screencast in README
- [ ] telnet: gopher://bitreich.org/1/lawn/bbs
@ -60,7 +59,6 @@ Just unzip/untar the `phetch` program into your $PATH and get going!
## bugs
- [ ] `open` silently fails on `irc://` links & friends
- [ ] gopher://1436.ninja/1/twit.cgi ("iWritten and performed by Nathaniel" weirdness)
## future features

@ -373,10 +373,17 @@ fn spawn_os_clipboard() -> Result<process::Child> {
// runs the `open` shell command
fn open_external(url: &str) -> Result<()> {
process::Command::new("open")
.arg(url)
.output()
.and_then(|_| Ok(()))
let output = process::Command::new("open").arg(url).output()?;
if output.stderr.is_empty() {
Ok(())
} else {
Err(error!(
"`open` error: {}",
String::from_utf8(output.stderr)
.unwrap_or("?".into())
.trim_end()
))
}
}
/// Ask user to confirm action with ENTER or Y.

Loading…
Cancel
Save