summaryrefslogtreecommitdiffstats
path: root/vendor/opener/src/macos.rs
blob: 0459ae81f857854636f8732b4cf007b5aabdb5fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::OpenError;
use std::ffi::OsStr;
use std::process::{Command, Stdio};

pub(crate) fn open(path: &OsStr) -> Result<(), OpenError> {
    let mut open = Command::new("open")
        .arg(path)
        .stdin(Stdio::null())
        .stdout(Stdio::null())
        .stderr(Stdio::piped())
        .spawn()
        .map_err(OpenError::Io)?;

    crate::wait_child(&mut open, "open")
}