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,4 +1,4 @@
use super::terminal::Terminal;
use super::terminal::*;
use failure::Error;
use self_update_crate;
#[cfg(unix)]
@@ -8,8 +8,8 @@ use std::os::unix::process::CommandExt;
#[cfg(unix)]
use std::process::Command;
pub fn self_update(terminal: &mut Terminal) -> Result<(), Error> {
terminal.print_separator("Self update");
pub fn self_update() -> Result<(), Error> {
print_separator("Self update");
#[cfg(unix)]
let current_exe = env::current_exe();
@@ -35,7 +35,7 @@ pub fn self_update(terminal: &mut Terminal) -> Result<(), Error> {
#[cfg(unix)]
{
if result.updated() {
terminal.print_warning("Respawning...");
print_warning("Respawning...");
let err = Command::new(current_exe?).args(env::args().skip(1)).exec();
Err(err)?
}