fix os error when deleting package and builds folder not available
This commit is contained in:
parent
a7bfad31c1
commit
1a09c1cdf9
@ -45,7 +45,8 @@ pub async fn remove_pkg(db: &DatabaseConnection, pkg_id: i32) -> anyhow::Result<
|
|||||||
.await?
|
.await?
|
||||||
.ok_or(anyhow!("id not found"))?;
|
.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()
|
let versions = Versions::find()
|
||||||
.filter(versions::Column::PackageId.eq(pkg.id))
|
.filter(versions::Column::PackageId.eq(pkg.id))
|
||||||
|
Loading…
Reference in New Issue
Block a user