pipx (fix #76)
This commit is contained in:
@@ -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 Python packages installed using [pipx](https://github.com/cs01/pipx)
|
||||
* 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)
|
||||
|
||||
@@ -161,6 +161,26 @@ pub fn run_opam_update(terminal: &mut Terminal, dry_run: bool) -> Option<(&'stat
|
||||
None
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn run_pipx_update(terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
|
||||
if let Some(pipx) = utils::which("pipx") {
|
||||
terminal.print_separator("pipx");
|
||||
|
||||
let success = || -> Result<(), Error> {
|
||||
Executor::new(&pipx, dry_run)
|
||||
.arg("upgrade-all")
|
||||
.spawn()?
|
||||
.wait()?
|
||||
.check()?;
|
||||
Ok(())
|
||||
}().is_ok();
|
||||
|
||||
return Some(("pipx", success));
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn run_custom_command(name: &str, command: &str, terminal: &mut Terminal, dry_run: bool) -> Result<(), Error> {
|
||||
terminal.print_separator(name);
|
||||
|
||||
@@ -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_pipx_update(terminal, opt.dry_run),
|
||||
&mut execution_context,
|
||||
)?);
|
||||
report.push_result(execute(
|
||||
|terminal| generic::run_jetpack(terminal, opt.dry_run),
|
||||
&mut execution_context,
|
||||
|
||||
Reference in New Issue
Block a user