diff --git a/README.md b/README.md index a4d5437b..76b3c30f 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,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 [vcpkg](https://github.com/Microsoft/vcpkg) globally installed packages * 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: diff --git a/src/generic.rs b/src/generic.rs index d55ab011..9cbd1b7e 100644 --- a/src/generic.rs +++ b/src/generic.rs @@ -161,6 +161,22 @@ pub fn run_opam_update(terminal: &mut Terminal, dry_run: bool) -> Option<(&'stat None } +#[must_use] +pub fn run_vcpkg_update(terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> { + if let Some(vcpkg) = utils::which("vcpkg") { + terminal.print_separator("vcpkg"); + + let success = || -> Result<(), Error> { + Executor::new(&vcpkg, dry_run).args(&["upgrade", "--no-dry-run"]).spawn()?.wait()?.check()?; + Ok(()) + }().is_ok(); + + return Some(("vcpkg", success)); + } + + 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") { diff --git a/src/main.rs b/src/main.rs index c4b46362..2381410d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -322,6 +322,10 @@ fn run() -> Result<(), Error> { |terminal| generic::run_opam_update(terminal, opt.dry_run), &mut execution_context, )?); + report.push_result(execute( + |terminal| generic::run_vcpkg_update(terminal, opt.dry_run), + &mut execution_context, + )?); report.push_result(execute( |terminal| generic::run_pipx_update(terminal, opt.dry_run), &mut execution_context,