diff --git a/.changes/clean.md b/.changes/clean.md new file mode 100644 index 0000000..af5b75a --- /dev/null +++ b/.changes/clean.md @@ -0,0 +1,5 @@ +--- +"eval-stack": patch:fix +--- + +Fixed `eval-stack` won't clean up the temporary files if failed to compile. diff --git a/Cargo.lock b/Cargo.lock index 6852dce..86817fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -922,7 +922,7 @@ dependencies = [ [[package]] name = "eval-stack" -version = "0.3.0" +version = "0.3.2" dependencies = [ "anyhow", "chrono", diff --git a/src/case.rs b/src/case.rs index c60931b..304c9aa 100644 --- a/src/case.rs +++ b/src/case.rs @@ -47,6 +47,11 @@ where ) .await { + if clean { + if let Err(e) = remove_dir_all(workspace).await { + anyhow::bail!("Failed to remove workspace: {}", e); + } + } return Ok(vec![JudgeResult { status: JudgeStatus::CompileError { message: e.to_string(),