diff --git a/src/steps/generic.rs b/src/steps/generic.rs index 2dae37a6..c9bdbbc0 100644 --- a/src/steps/generic.rs +++ b/src/steps/generic.rs @@ -529,12 +529,23 @@ pub fn run_conda_update(ctx: &ExecutionContext) -> Result<()> { print_separator("Conda"); - let mut command = ctx.run_type().execute(conda); + let mut command = ctx.run_type().execute(&conda); command.args(["update", "--all", "-n", "base"]); if ctx.config().yes(Step::Conda) { command.arg("--yes"); } - command.status_checked() + command.status_checked()?; + + if ctx.config().cleanup() { + let mut command = ctx.run_type().execute(conda); + command.args(["clean", "--all"]); + if ctx.config().yes(Step::Conda) { + command.arg("--yes"); + } + command.status_checked()?; + } + + Ok(()) } pub fn run_pixi_update(ctx: &ExecutionContext) -> Result<()> { @@ -549,12 +560,23 @@ pub fn run_mamba_update(ctx: &ExecutionContext) -> Result<()> { print_separator("Mamba"); - let mut command = ctx.run_type().execute(mamba); + let mut command = ctx.run_type().execute(&mamba); command.args(["update", "--all", "-n", "base"]); if ctx.config().yes(Step::Mamba) { command.arg("--yes"); } - command.status_checked() + command.status_checked()?; + + if ctx.config().cleanup() { + let mut command = ctx.run_type().execute(&mamba); + command.args(["clean", "--all"]); + if ctx.config().yes(Step::Mamba) { + command.arg("--yes"); + } + command.status_checked()?; + } + + Ok(()) } pub fn run_miktex_packages_update(ctx: &ExecutionContext) -> Result<()> {