Add Jetpack (fix #80)

This commit is contained in:
Roey Darwish Dror
2018-10-18 16:05:27 +03:00
parent 4c16a34053
commit 036a86f593
3 changed files with 25 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ Just run `topgrade`. It will run the following steps:
* Run Cargo [install-update](https://github.com/nabijaczleweli/cargo-update)
* Upgrade Emacs packages (You'll get a better output if you have [Paradox](https://github.com/Malabarba/paradox) installed)
* Upgrade [OCaml packages](https://opam.ocaml.org/)
* Upgrade [R globally installed packages](https://github.com/ankane/jetpack)
* Upgrade Vim/Neovim packages. Works with the following plugin frameworks:
* [NeoBundle](https://github.com/Shougo/neobundle.vim)
* [Vundle](https://github.com/VundleVim/Vundle.vim)

View File

@@ -124,6 +124,26 @@ pub fn run_rustup(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: bool)
None
}
#[must_use]
pub fn run_jetpack(terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
if let Some(jetpack) = utils::which("jetpack") {
terminal.print_separator("Jetpack");
let success = || -> Result<(), Error> {
Executor::new(&jetpack, dry_run)
.args(&["global", "update"])
.spawn()?
.wait()?
.check()?;
Ok(())
}().is_ok();
return Some(("Jetpack", success));
}
None
}
#[must_use]
pub fn run_opam_update(terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
if let Some(opam) = utils::which("opam") {

View File

@@ -265,6 +265,10 @@ fn run() -> Result<(), Error> {
|terminal| generic::run_opam_update(terminal, opt.dry_run),
&mut execution_context,
)?);
report.push_result(execute(
|terminal| generic::run_jetpack(terminal, opt.dry_run),
&mut execution_context,
)?);
report.push_result(execute(
|terminal| vim::upgrade_vim(&base_dirs, terminal, opt.dry_run),
&mut execution_context,