Skip to content

Commit

Permalink
fix(serverless): assets directory not deleting on undeploys (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuiiBz authored Oct 15, 2022
1 parent 43d4df4 commit 2830c24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/proud-pants-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lagon/serverless': patch
---

Fix assets directory not deleting on undeploys
2 changes: 1 addition & 1 deletion packages/serverless/src/deployments/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn rm_deployment(deployment_id: &str) -> io::Result<()> {
fs::remove_file(Path::new("deployments").join(deployment_id.to_owned() + ".js"))?;

// It's possible that the folder doesn't exists if the deployment has no assets
fs::remove_dir(Path::new("deployments").join(deployment_id)).unwrap_or(());
fs::remove_dir_all(Path::new("deployments").join(deployment_id)).unwrap_or(());
info!("Deleted deployment: {}", deployment_id);

Ok(())
Expand Down

0 comments on commit 2830c24

Please sign in to comment.