1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-05-30 08:36:47 +02:00

fix: use remove_dir_all for removal of temp directories

Signed-off-by: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com>
This commit is contained in:
TheGeneralist 2026-03-31 12:49:44 +02:00
parent 2d59ab0af5
commit 9441a9d9fb
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4

View file

@ -350,7 +350,7 @@ fn main() -> Result<()> {
// Dir or whatever. it's midnight and my brain ain't wording/braining. // Dir or whatever. it's midnight and my brain ain't wording/braining.
if hash_exists { if hash_exists {
println!("File already archived."); println!("File already archived.");
let _ = fs::remove_file(store_path.join("temp").join(&timestamp)); let _ = fs::remove_dir_all(store_path.join("temp").join(&timestamp));
} else { } else {
move_temp_to_raw( move_temp_to_raw(
&store_path &store_path
@ -360,7 +360,7 @@ fn main() -> Result<()> {
&hash, &hash,
&store_path, &store_path,
)?; )?;
let _ = fs::remove_file(store_path.join("temp").join(&timestamp)); let _ = fs::remove_dir_all(store_path.join("temp").join(&timestamp));
println!("File archived successfully."); println!("File archived successfully.");
} }