I'm a first time Ruby user (any programming code for that matter) and I'm trying to create a script within "maid" to copy all of my music from a specific folder into the "automatically add to itunes" folder:
rule 'Move Downloaded Music to iTunes' do
FileUtils.cp_r '/Users/*********/Movies/*********/Music/.',
'/Users/*********/Music/iTunes/iTunes Media/Automatically Add to iTunes/',
:remove_destination => true
end
However, I have non-music files within that same folder and I want to include only files with audio formats (mp3, m4a, etc.)
How can I append this code so that I can choose which file types are copied?
Additionally, what is the difference between cp_r and cp?
Any advice or improvements to my code are more than welcome - I've seen people try to do similar things with much more complicated code, so in a sense I'm worried mine is too simple...Thanks for the help!!