Merge pull request #8 from alexwlchan/thumbs-db
- ID
2f300a5- date
2024-07-26 23:19:05+00:00- author
Alex Chan <alex@alexwlchan.net>- parents
7137587,cd1c0f3- message
Merge pull request #8 from alexwlchan/thumbs-db Delete empty folders which only contain a `Thumbs.db` file- changed files
4 files, 11 additions, 5 deletions
Changed files
CHANGELOG.md (54) → CHANGELOG.md (206)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3032ab6..5af5eb4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## v1.1.0 - 2024-07-27
+
+Delete empty folders which only contain [a `Thumbs.db` file](https://en.wikipedia.org/wiki/Windows_thumbnail_cache#Thumbs.db).
+
## v1.0.0 - 2024-06-18
Initial release.
Cargo.lock (13005) → Cargo.lock (13005)
diff --git a/Cargo.lock b/Cargo.lock
index b7ba493..b8fadea 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -115,7 +115,7 @@ dependencies = [
[[package]]
name = "emptydir"
-version = "1.0.0"
+version = "1.1.0"
dependencies = [
"clap",
"colored",
Cargo.toml (203) → Cargo.toml (203)
diff --git a/Cargo.toml b/Cargo.toml
index 189bfab..92ab8e7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "emptydir"
-version = "1.0.0"
+version = "1.1.0"
edition = "2021"
[dependencies]
src/can_be_deleted.rs (4178) → src/can_be_deleted.rs (4291)
diff --git a/src/can_be_deleted.rs b/src/can_be_deleted.rs
index 30a0978..d1ac0a9 100644
--- a/src/can_be_deleted.rs
+++ b/src/can_be_deleted.rs
@@ -34,18 +34,20 @@ pub fn can_be_deleted(path: &Path) -> bool {
//
// * .DS_Store stores some folder attributes used for showing the folder
// in the Finder, which I don't need to keep
- // * `__pycache__` is the bytecode cache in Python projects, which is
- // pointless if the original Python files have been removed
// * `.venv` is the name I use for virtual environments, which I can
// easily regenerate if necessary
+ // * `__pycache__` is the bytecode cache in Python projects, which is
+ // pointless if the original Python files have been removed
+ // * `Thumbs.db` is a file that contains thumbnails on Windows systems
//
// A directory is safe to delete if the ONLY things it contains are these entries;
// any other entry should block the directory from being deleted.
//
let deletable_names = HashSet::from([
OsString::from(".ds_store"),
- OsString::from("__pycache__"),
OsString::from(".venv"),
+ OsString::from("__pycache__"),
+ OsString::from("thumbs.db"),
]);
match get_names_in_directory(path) {