feat: handle multiple positional file arguments

This commit is contained in:
2026-09-04 19:07:03 +02:00
parent 5fd47b445e
commit e1e56f7e27
2 changed files with 33 additions and 26 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ pub fn move_files(
should_copy: bool,
has_parent: bool,
) -> Result<(), Box<dyn std::error::Error>> {
let target_dir = PathBuf::from("/home/user/Desktop/coding/keks-sort");
let target_dir = PathBuf::from("/home/user/Music/Tracks");
let artist = tag.artist();
let album = tag.album();
@@ -67,8 +67,8 @@ pub fn move_files(
}
}
let is_empty = file_path.parent().unwrap().read_dir()?.next().is_none();
if has_parent && is_empty {
let is_empty = has_parent && file_path.parent().unwrap().read_dir()?.next().is_none();
if is_empty {
remove_dir(file_path.parent().unwrap())?;
}