fix: Support yes option for opam upgrade (#570)

This commit is contained in:
Mylloon
2023-10-10 02:08:46 +02:00
committed by GitHub
parent 1f6baefdc3
commit d68fcb08b2

View File

@@ -287,7 +287,13 @@ pub fn run_opam_update(ctx: &ExecutionContext) -> Result<()> {
print_separator("OCaml Package Manager");
ctx.run_type().execute(&opam).arg("update").status_checked()?;
ctx.run_type().execute(&opam).arg("upgrade").status_checked()?;
let mut command = ctx.run_type().execute(&opam);
command.arg("upgrade");
if ctx.config().yes(Step::Opam) {
command.arg("--yes");
}
command.status_checked()?;
if ctx.config().cleanup() {
ctx.run_type().execute(&opam).arg("clean").status_checked()?;