Skip to content

Commit 43578c0

Browse files
committed
Edit the previous commit clearing up only matching files
1 parent 714cfe5 commit 43578c0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/utils/filesystem_operations.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ pub fn clear_cache() {
7474
if let Ok(contents) = std::fs::read_dir(obtain_cache_directory().unwrap()) {
7575
for entry in contents {
7676
if let Ok(entry) = entry {
77-
std::fs::remove_file(entry.path()).ok();
77+
if entry
78+
.file_name()
79+
.to_str()
80+
.unwrap_or("")
81+
.starts_with("songrec_cover_")
82+
{
83+
std::fs::remove_file(entry.path()).ok();
84+
}
7885
}
7986
}
8087
}

0 commit comments

Comments
 (0)