Remove execute legacy

This commit is contained in:
Roey Darwish Dror
2019-03-10 21:48:49 +02:00
parent 12bf4a51f9
commit 1095f46a8a
7 changed files with 86 additions and 135 deletions

View File

@@ -10,24 +10,15 @@ use std::os::unix::process::CommandExt;
use std::path::Path;
use std::process::Command;
pub fn run_tpm(base_dirs: &BaseDirs, run_type: RunType) -> Option<(&'static str, bool)> {
if let Some(tpm) = base_dirs
pub fn run_tpm(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Error> {
let tpm = base_dirs
.home_dir()
.join(".tmux/plugins/tpm/bin/update_plugins")
.if_exists()
{
print_separator("tmux plugins");
.require()?;
let success = || -> Result<(), Error> {
run_type.execute(&tpm).arg("all").check_run()?;
Ok(())
}()
.is_ok();
print_separator("tmux plugins");
return Some(("tmux", success));
}
None
run_type.execute(&tpm).arg("all").check_run()
}
fn has_session(tmux: &Path, session_name: &str) -> Result<bool, io::Error> {