Browse Source

move Caskroom into opt for spotlight goodness

phinze 12 years ago
parent
commit
d92ca8fefd
  1. 14
      lib/cask.rb
  2. 3
      test/test_helper.rb

14
lib/cask.rb

@ -18,7 +18,11 @@ class Cask
end
def self.caskroom
HOMEBREW_PREFIX.join "Caskroom"
@@caskroom ||= Pathname('/opt/homebrew-cask/Caskroom')
end
def self.caskroom=(caskroom)
@@caskroom = caskroom
end
def self.appdir
@ -39,7 +43,13 @@ class Cask
def self.init
HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exist?
caskroom.mkpath unless caskroom.exist?
unless caskroom.exist?
ohai "We need to make Caskroom for the first time at #{caskroom}"
ohai "We'll set permissions properly so this is the only time homebrew-cask will ever need sudo"
current_user = ENV['USER']
system "sudo mkdir -p #{caskroom}"
system "sudo chown #{current_user}:staff #{caskroom.parent}"
end
appdir.mkpath unless appdir.exist?
end

3
test/test_helper.rb

@ -28,6 +28,9 @@ require 'cask'
# look for casks in testcasks by default
Cask.default_tap = 'phinze-testcasks'
# our own testy caskroom
Cask.caskroom = HOMEBREW_PREFIX.join('TestCaskroom')
# silence some extraneous UI messages for tests
ENV['QUIET_TESTS'] = '1'

Loading…
Cancel
Save