diff --git a/src/Cargo.lock b/src/Cargo.lock index 73a0370..869b34c 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -1145,7 +1145,7 @@ dependencies = [ [[package]] name = "orangutan-server" -version = "0.4.8" +version = "0.4.9" dependencies = [ "base64 0.22.1", "biscuit-auth", diff --git a/src/helpers/src/generate.rs b/src/helpers/src/generate.rs index 70ce308..1f68a1b 100644 --- a/src/helpers/src/generate.rs +++ b/src/helpers/src/generate.rs @@ -361,7 +361,9 @@ pub fn trash_outdated_websites() -> Result { // 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())?; + if TRASH_DIR.exists() { + fs::remove_dir_all(TRASH_DIR.as_path())?; + } // Remove outdated websites fs::rename(DEST_DIR.as_path(), TRASH_DIR.as_path())?; diff --git a/src/orangutan-server/Cargo.toml b/src/orangutan-server/Cargo.toml index e594db3..8a7ac44 100644 --- a/src/orangutan-server/Cargo.toml +++ b/src/orangutan-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "orangutan-server" -version = "0.4.8" +version = "0.4.9" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html