diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-07-19 21:33:08 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-07-19 22:18:23 -0400 |
commit | 0b8747eb37d6d943d90e15ed82858d99d1800425 (patch) | |
tree | 6cb910dc37343000296c2951e0f67ff269ee3efd /src/unix.rs | |
parent | 98e9665e59d7af0b2c002f0e6007578b3e90aa69 (diff) |
changed how commands are handled
- arguments no longer go through wordexp (still working on a good alternative)
other changes:
- changed update_contents to reload_contents
- opening files with mimetype entries are now moved from unix.rs
to mimetypes.rs
Diffstat (limited to 'src/unix.rs')
-rw-r--r-- | src/unix.rs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/unix.rs b/src/unix.rs index 3b61f93..7904ee9 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -67,31 +67,6 @@ pub fn set_mode(path: &Path, mode: u32) { } } -pub fn open_with_entry(paths: &[&PathBuf], entry: &mimetype::JoshutoMimetypeEntry) { - let program = String::from(entry.get_command()); - - let mut command = process::Command::new(program); - if entry.get_silent() { - command.stdout(process::Stdio::null()); - command.stderr(process::Stdio::null()); - } - - command.args(entry.get_args()); - command.args(paths.iter().map(|path| path.as_os_str())); - - match command.spawn() { - Ok(mut handle) => { - if !entry.get_fork() { - match handle.wait() { - Ok(_) => {} - Err(e) => eprintln!("{}", e), - } - } - } - Err(e) => eprintln!("{}", e), - }; -} - pub fn open_with_args(paths: &[&PathBuf], args: &[String]) { let program = args[0].clone(); |