Skip to content

Commit 5da73c1

Browse files
authored
Merge pull request #10 from santoshxshrestha/flag
fix: other flags will now work with the --ignore flag
2 parents c7ef79a + 34ade82 commit 5da73c1

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.1.9] - 2025
11+
12+
### Fixed
13+
- **Critical ignore flag bug**: Fixed issue where `-i, --ignore` flag was not functioning correctly, causing errors while trying to ingore them while using `rmxt` commands
14+
15+
### Changed
16+
- Imporved different cases handling in the ignore flag logic with match block
17+
18+
### Added
19+
1020
## [0.1.9] - 2025-09-01
1121

1222
### Fixed

src/main.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,24 +260,32 @@ All the contents from the trash more then {days} days will be deleted permanentl
260260
continue;
261261
}
262262

263-
match (ignore, path.is_dir(), path.is_file()) {
264-
(true, true, _) => {
263+
match (ignore, dir, path.is_dir(), path.is_file(), recursive) {
264+
(true, false, true, _, true) => {
265265
if let Err(e) = fs::remove_dir_all(&path) {
266266
eprintln!(
267267
"{}",
268-
format!("Error deleting with out moving to trash: {e}").red()
268+
format!("Error deleting without moving to trash: {e}").red()
269269
)
270270
}
271271
}
272-
(true, false, true) => {
272+
(true, true, true, _, false) => {
273+
if let Err(e) = fs::remove_dir(&path) {
274+
eprintln!(
275+
"{}",
276+
format!("Error deleting without moving to trash: {e}").red()
277+
)
278+
}
279+
}
280+
(true, _, false, true, _) => {
273281
if let Err(e) = fs::remove_file(&path) {
274282
eprintln!(
275283
"{}",
276-
format!("Error deleting with out moving to trash: {e}").red()
284+
format!("Error deleting without moving to trash: {e}").red()
277285
)
278286
}
279287
}
280-
(false, _, _) => {
288+
(false, _, _, _, _) => {
281289
if let Err(e) = delete(&path) {
282290
eprintln!("{}", format!("Error moving to trash: {e}").red());
283291
}

0 commit comments

Comments
 (0)