feat: handle multiple positional file arguments
This commit is contained in:
+3
-3
@@ -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())?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user