Merge pull request #6478 from rolandwalker/doctor_caskroom

print caskroom location in `brew cask doctor`
This commit is contained in:
Roland Walker 2014-10-06 06:19:18 -04:00
commit 32e5b80c2f
2 changed files with 15 additions and 0 deletions

View file

@ -47,6 +47,9 @@ class Cask
def self.init
set_up_taps
# todo: Creating directories should be deferred until needed.
# Currently this fire and even asks for sudo password
# if a first-time user simply runs "brew cask --help".
odebug 'Creating directories'
HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exist?
HOMEBREW_CACHE_CASKS.mkpath unless HOMEBREW_CACHE_CASKS.exist?

View file

@ -11,6 +11,7 @@ class Cask::CLI::Doctor < Cask::CLI::Base
ohai 'Homebrew Origin:', render_with_none_as_error( homebrew_origin )
ohai 'Homebrew-cask Version:', render_with_none_as_error( HOMEBREW_CASK_VERSION )
ohai 'Homebrew-cask Install Location:', render_install_location( HOMEBREW_CASK_VERSION )
ohai 'Homebrew-cask Staging Location:', render_staging_location( Cask.caskroom )
ohai 'Homebrew-cask Cached Downloads:', render_cached_downloads
ohai 'Homebrew-cask Default Tap Path:', render_tap_paths( fq_default_tap )
ohai 'Homebrew-cask Alternate Cask Taps:', render_tap_paths( alt_taps )
@ -150,6 +151,17 @@ class Cask::CLI::Doctor < Cask::CLI::Base
end
end
def self.render_staging_location(path)
path = Pathname.new(path)
if !path.exist?
%Q{#{path} #{error_string %Q{error: path does not exist}}}
elsif !path.writable?
%Q{#{path} #{error_string %Q{error: not writable by current user}}}
else
path
end
end
def self.render_load_path(paths)
if paths.nil? or paths.size == 0
return "#{none_string} #{error_string}"