Last active
November 22, 2017 20:02
-
-
Save aledalgrande/b3cb880058bfd95ebe8e to your computer and use it in GitHub Desktop.
Flatten your iTunes folder keeping artist names in the filename with Ruby: change /Volumes/Backup/iTunes to whatever destination folder you want
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby -e 'require "fileutils";Dir.glob("./**/*").reject { |d| File.directory?( d ) }.map { |f| [f, "/Volumes/Backup/iTunes/#{File.dirname(f).gsub(/([^\.])\//, "#{$1}-")}-#{File.basename(f)}"] }.map { |f| FileUtils.cp(f[0], f[1], verbose: true) }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To run it: