diff --git a/README.md b/README.md index ff020a6b..8f43bd9c 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ Just run `topgrade`. It will run the following steps: * Upgrade [myrepos](https://myrepos.branchable.com/) managed sourcecode repositories * Upgrade Python packages installed using [pipx](https://github.com/cs01/pipx) * Upgrade [R globally installed packages](https://github.com/ankane/jetpack) +* Upgrade [stack](https://docs.haskellstack.org/en/stable/README/) * Upgrade Vim/Neovim packages. Works with the following plugin frameworks: * [NeoBundle](https://github.com/Shougo/neobundle.vim) * [Vundle](https://github.com/VundleVim/Vundle.vim) diff --git a/src/main.rs b/src/main.rs index e556da6a..7f5e1776 100644 --- a/src/main.rs +++ b/src/main.rs @@ -358,6 +358,12 @@ fn run() -> Result<(), Error> { || generic::run_pipx_update(run_type), config.no_retry(), )?; + execute( + &mut report, + "stack", + || generic::run_stack_update(run_type), + config.no_retry(), + )?; execute( &mut report, "myrepos", diff --git a/src/steps/generic.rs b/src/steps/generic.rs index 71ac0da8..2e25d780 100644 --- a/src/steps/generic.rs +++ b/src/steps/generic.rs @@ -88,6 +88,13 @@ pub fn run_pipx_update(run_type: RunType) -> Result<(), Error> { run_type.execute(&pipx).arg("upgrade-all").check_run() } +pub fn run_stack_update(run_type: RunType) -> Result<(), Error> { + let stack = utils::require("stack")?; + print_separator("stack"); + + run_type.execute(&stack).arg("upgrade").check_run() +} + pub fn run_myrepos_update(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Error> { let myrepos = utils::require("mr")?; base_dirs.home_dir().join(".mrconfig").require()?;