Run fisher self-update

This commit is contained in:
Roey Darwish Dror
2018-10-07 11:51:12 +03:00
parent 0f67bbaf0c
commit 51d67d6529
2 changed files with 10 additions and 5 deletions

View File

@@ -189,7 +189,7 @@ fn run() -> Result<(), Error> {
&mut terminal,
));
report.push_result(execute(
|terminal| unix::run_fisherman(&base_dirs, terminal, opt.dry_run),
|terminal| unix::run_fisher(&base_dirs, terminal, opt.dry_run),
&mut terminal,
));
report.push_result(execute(

View File

@@ -25,13 +25,18 @@ pub fn run_zplug(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: bool) -
None
}
pub fn run_fisherman(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
pub fn run_fisher(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
if let Some(fish) = which("fish") {
if base_dirs.home_dir().join(".config/fish/functions/fisher.fish").exists() {
terminal.print_separator("fisherman");
terminal.print_separator("fisher");
let success = || -> Result<(), Error> {
Executor::new(fish, dry_run)
Executor::new(&fish, dry_run)
.args(&["-c", "fisher self-update"])
.spawn()?
.wait()?
.check()?;
Executor::new(&fish, dry_run)
.args(&["-c", "fisher"])
.spawn()?
.wait()?
@@ -39,7 +44,7 @@ pub fn run_fisherman(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: boo
Ok(())
}().is_ok();
return Some(("fisherman", success));
return Some(("fisher", success));
}
}