Skip to content

Instantly share code, notes, and snippets.

@jaymcgavren
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaymcgavren/82f90cc987bcf4b40c86 to your computer and use it in GitHub Desktop.
Save jaymcgavren/82f90cc987bcf4b40c86 to your computer and use it in GitHub Desktop.
These Homebrew Casks are a proof of concept for downloading and managing music distributed under Creative Commons and other open licenses.
class BrokeForFree_goldCanStay < Cask
version 'latest'
sha256 :no_check
url 'http://jay.mcgavren.com/files/Broke_For_Free_-_Gold_Can_Stay.zip'
homepage 'http://brokeforfree.com/'
prefix = 'Music/Caskroom'
artist_name = 'Broke for Free'
album_name = 'Gold Can Stay'
path = File.join(prefix, artist_name, album_name)
link 'Broke_For_Free_-_01_-_Budding.mp3', :target => File.join(path, '01 Budding.mp3')
link 'Broke_For_Free_-_02_-_942_Miles.mp3', :target => File.join(path, '02 942 Miles.mp3')
link 'Broke_For_Free_-_03_-_The_Gold_Lining.mp3', :target => File.join(path, '03 The Gold Lining.mp3')
link 'Broke_For_Free_-_04_-_Things_To_Come.mp3', :target => File.join(path, '04 Things to Come.mp3')
end
class Spinmeister_echoesOfTheMind < Cask
version 'latest'
sha256 :no_check
container_type :naked
url 'http://ccmixter.org/content/spinmeister/spinmeister_-_Echoes_of_the_Mind.mp3'
homepage 'http://dig.ccmixter.org/files/spinmeister/47299'
prefix = 'Music/Caskroom'
artist_name = 'spinmeister'
album_name = 'Unknown Album'
path = File.join(prefix, artist_name, album_name)
link 'spinmeister_-_Echoes_of_the_Mind.mp3', :target => File.join(path, '01 Echoes of the Mind.mp3')
end
@jaymcgavren
Copy link
Author

To "install" two casks at once:

brew install caskroom/cask/brew-cask
brew cask install https://gist.githubusercontent.com/jaymcgavren/82f90cc987bcf4b40c86/raw/broke-for-free_gold-can-stay.rb https://gist.githubusercontent.com/jaymcgavren/82f90cc987bcf4b40c86/raw/spinmeister_echoes-of-the-mind.rb

The MP3 files will be linked to ~/Applications/Music/Caskroom/<Artist>/<Album>/.

Needed improvements:

  • Link to ~/Music/Caskroom instead of ~/Applications/Music/Caskroom.
  • A better system for Cask naming that accommodates the artist and album name.
  • A better way to make Casks for individual tracks as well as albums.
  • Actual files are stored in /opt/homebrew-cask/Caskroom, alongside applications and such. Should a different prefix be used?
  • An actual tap might scale better than a Gist. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment