Skip to content

Commit

Permalink
🚑 Fix trash not emptied in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBardon committed Aug 8, 2024
1 parent 31bace9 commit 990385b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Cargo.lock

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

6 changes: 6 additions & 0 deletions src/helpers/src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@ pub fn create_tmp_dir() -> Result<(), Error> {
pub fn trash_outdated_websites() -> Result<State, Error> {
trace!("Trashing outdated websites…");

// Empty the trash (it's at least `HEAD~2` so we can safely delete it)
// NOTE: This whould not be necessary since the directory should be deleted
// but there might be edge cases where it's still there and the next
// `fs::rename` will fail if it's the case.
fs::remove_dir_all(TRASH_DIR.as_path())?;

// Remove outdated websites
fs::rename(DEST_DIR.as_path(), TRASH_DIR.as_path())?;

Expand Down
2 changes: 1 addition & 1 deletion src/orangutan-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "orangutan-server"
version = "0.4.6"
version = "0.4.7"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down

0 comments on commit 990385b

Please sign in to comment.