diff options
| author | yuzu-eva <cafebabe@disroot.org> | 2025-06-05 21:52:12 +0200 |
|---|---|---|
| committer | yuzu-eva <cafebabe@disroot.org> | 2025-06-05 21:52:12 +0200 |
| commit | a03ab7c9a56260e89ae6bfa803eaca13ae3eb557 (patch) | |
| tree | dd5d140828b0f3ebd289b9c0b4413275b6749299 /tag-tracks | |
| parent | 661e986dd8f9acd6fdfb6951968504a390517c59 (diff) | |
get directory from command line argument; error out if no arg given
Diffstat (limited to 'tag-tracks')
| -rwxr-xr-x | tag-tracks | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -3,7 +3,17 @@ require 'taglib' require 'fileutils' -Dir.chdir("/media/hdd/music/Youtube Downloads") +if ARGV.empty? + puts "ERROR: no argument given..." + puts "usage: tag-tracks TARGET_DIR" + return 69 +end + +target_dir = ARGV.first + +Dir.chdir("#{target_dir}") + +puts "Tagging Tracks in #{Dir.pwd} ..." mp3_files = Dir.glob("*").sort_by { |x| File.basename(x).downcase } @@ -19,3 +29,5 @@ mp3_files.each do |song| track_num += 1 end end + +puts "Done!" |
