Clean up OPAM if requested (#12)
OPAM has a built-in `clean` command that automatically removes download caches, logs, and cleans the current OPAM switch. We should call `opam clean` when the cleanup flag is set. Authored-by: Victor Song <vms2@rice.edu> Approved-by: Thomas Schönauer <t.schoenauer@hgs-wt.at>
This commit is contained in:
@@ -220,13 +220,19 @@ pub fn run_rtcl(ctx: &ExecutionContext) -> Result<()> {
|
||||
ctx.run_type().execute(&rupdate).check_run()
|
||||
}
|
||||
|
||||
pub fn run_opam_update(run_type: RunType) -> Result<()> {
|
||||
pub fn run_opam_update(ctx: &ExecutionContext) -> Result<()> {
|
||||
let opam = utils::require("opam")?;
|
||||
|
||||
print_separator("OCaml Package Manager");
|
||||
|
||||
run_type.execute(&opam).arg("update").check_run()?;
|
||||
run_type.execute(&opam).arg("upgrade").check_run()
|
||||
ctx.run_type().execute(&opam).arg("update").check_run()?;
|
||||
ctx.run_type().execute(&opam).arg("upgrade").check_run()?;
|
||||
|
||||
if ctx.config().cleanup() {
|
||||
ctx.run_type().execute(&opam).arg("clean").check_run()?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn run_vcpkg_update(run_type: RunType) -> Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user