Stop passing the terminal object

This commit is contained in:
Roey Darwish Dror
2018-12-05 11:34:08 +02:00
parent 09cfb81ba5
commit 39faab0a12
14 changed files with 217 additions and 323 deletions

View File

@@ -1,5 +1,5 @@
use super::executor::Executor;
use super::terminal::Terminal;
use super::terminal::print_separator;
use super::utils::which;
use super::utils::{Check, PathExt};
use directories::BaseDirs;
@@ -10,13 +10,13 @@ use std::os::unix::process::CommandExt;
use std::path::Path;
use std::process::Command;
pub fn run_tpm(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
pub fn run_tpm(base_dirs: &BaseDirs, dry_run: bool) -> Option<(&'static str, bool)> {
if let Some(tpm) = base_dirs
.home_dir()
.join(".tmux/plugins/tpm/bin/update_plugins")
.if_exists()
{
terminal.print_separator("tmux plugins");
print_separator("tmux plugins");
let success = || -> Result<(), Error> {
Executor::new(&tpm, dry_run).arg("all").spawn()?.wait()?.check()?;