From 1a09c1cdf922ee8d3cb88b12d16b7d6750b00751 Mon Sep 17 00:00:00 2001 From: lukas-heiligenbrunner Date: Sun, 14 Jan 2024 22:48:07 +0100 Subject: [PATCH] fix os error when deleting package and builds folder not available --- backend/src/repo/repo.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/repo/repo.rs b/backend/src/repo/repo.rs index 0a607e9..c197b77 100644 --- a/backend/src/repo/repo.rs +++ b/backend/src/repo/repo.rs @@ -45,7 +45,8 @@ pub async fn remove_pkg(db: &DatabaseConnection, pkg_id: i32) -> anyhow::Result< .await? .ok_or(anyhow!("id not found"))?; - fs::remove_dir_all(format!("./builds/{}", pkg.name))?; + // remove build dir if available + let _ = fs::remove_dir_all(format!("./builds/{}", pkg.name)); let versions = Versions::find() .filter(versions::Column::PackageId.eq(pkg.id))