Out of the Cellar, into the Caskroom

Install casks into HOMEBREW_PREFIX/"Caskroom" instead of the Cellar.
This prevents us from colliding with normal Homebrew Formulae.

NOTE: this will be a breaking change, with the following effects:

- all installed casks will no longer be reported as installed
- orphans all existing casks in the Cellar
- no automated facility for cleanup or migration of existing casks

refs #38, where we can discuss the implications of this before cutting a
new release
This commit is contained in:
phinze 2013-02-17 12:51:20 -06:00
parent 9219f2a6e1
commit 9189bd5be6
3 changed files with 10 additions and 5 deletions

View File

@ -18,8 +18,8 @@ class Cask
HOMEBREW_PREFIX.join "Library", "Taps"
end
def self.cellarpath
HOMEBREW_CELLAR
def self.caskroom
HOMEBREW_PREFIX.join "Caskroom"
end
def self.appdir
@ -32,6 +32,7 @@ class Cask
def self.init
HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exist?
caskroom.mkpath unless caskroom.exist?
appdir.mkpath unless appdir.exist?
end
@ -57,7 +58,7 @@ class Cask
end
def destination_path
HOMEBREW_CELLAR.join(self.title).join(self.version)
self.class.caskroom.join(self.title).join(self.version)
end
def installed?

View File

@ -78,6 +78,10 @@ class Cask::CLI
puts Cask::CLI.commands.map {|c| " - #{c.downcase}: #{_help_for(c)}"}.join("\n")
end
def help
''
end
def _help_for(command)
Cask::CLI.lookup_command(command).help
end

View File

@ -9,7 +9,7 @@ describe Cask::Installer do
Cask::Installer.install(caffeine)
end
dest_path = HOMEBREW_CELLAR/'local-caffeine'/caffeine.version
dest_path = Cask.caskroom/'local-caffeine'/caffeine.version
dest_path.must_be :directory?
application = dest_path/'Caffeine.app'
application.must_be :directory?
@ -22,7 +22,7 @@ describe Cask::Installer do
Cask::Installer.install(transmission)
end
dest_path = HOMEBREW_CELLAR/'local-transmission'/transmission.version
dest_path = Cask.caskroom/'local-transmission'/transmission.version
dest_path.must_be :directory?
application = dest_path/'Transmission.app'
application.must_be :directory?