Skip to content

Commit

Permalink
fix(clean): fix clean up on compilation errors (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
fu050409 authored Dec 5, 2024
1 parent cf80cc8 commit 6aa6076
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eval-stack": patch:fix
---

Fixed `eval-stack` won't clean up the temporary files if failed to compile.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 6aa6076

Please sign in to comment.