diff options
| author | Markus Reiter | 2016-09-19 19:07:55 +0200 |
|---|---|---|
| committer | GitHub | 2016-09-19 19:07:55 +0200 |
| commit | e22610aedd550cb5577dd08cedb7a5609d0ff0b8 (patch) | |
| tree | f4e87c725d7e6b032f5b042f15d0aeeba00696ad /Library/Homebrew/cask | |
| parent | 3ffb9a2f7cda6652f75cb0c59c6d079ab1039e94 (diff) | |
| parent | c0cc703516c1c32d42922dbb2af17c09fc340825 (diff) | |
| download | brew-e22610aedd550cb5577dd08cedb7a5609d0ff0b8.tar.bz2 | |
Merge pull request #1025 from reitermarkus/migrate-caskroom
Make `HOMEBREW_PREFIX/Caskroom` the default.
Diffstat (limited to 'Library/Homebrew/cask')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/caskroom.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/list.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/locations.rb | 2 |
4 files changed, 14 insertions, 1 deletions
diff --git a/Library/Homebrew/cask/lib/hbc.rb b/Library/Homebrew/cask/lib/hbc.rb index b45a9f375..fd61558ab 100644 --- a/Library/Homebrew/cask/lib/hbc.rb +++ b/Library/Homebrew/cask/lib/hbc.rb @@ -49,6 +49,7 @@ module Hbc Hbc::Cache.ensure_cache_exists Hbc::Cache.migrate_legacy_cache + Hbc::Caskroom.migrate_caskroom_from_repo_to_prefix Hbc::Caskroom.ensure_caskroom_exists end diff --git a/Library/Homebrew/cask/lib/hbc/caskroom.rb b/Library/Homebrew/cask/lib/hbc/caskroom.rb index cb471a125..7d02f3fa4 100644 --- a/Library/Homebrew/cask/lib/hbc/caskroom.rb +++ b/Library/Homebrew/cask/lib/hbc/caskroom.rb @@ -1,6 +1,14 @@ module Hbc::Caskroom module_function + def migrate_caskroom_from_repo_to_prefix + repo_caskroom = Hbc.homebrew_repository.join("Caskroom") + if !Hbc.caskroom.exist? && repo_caskroom.directory? + ohai "Moving Caskroom from HOMEBREW_REPOSITORY to HOMEBREW_PREFIX" + FileUtils.mv repo_caskroom, Hbc.caskroom + end + end + def ensure_caskroom_exists unless Hbc.caskroom.exist? ohai "Creating Caskroom at #{Hbc.caskroom}" diff --git a/Library/Homebrew/cask/lib/hbc/cli/list.rb b/Library/Homebrew/cask/lib/hbc/cli/list.rb index ce507a827..88907a797 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/list.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/list.rb @@ -79,4 +79,8 @@ class Hbc::CLI::List < Hbc::CLI::Base def self.help "with no args, lists installed Casks; given installed Casks, lists staged files" end + + def self.needs_init? + true + end end diff --git a/Library/Homebrew/cask/lib/hbc/locations.rb b/Library/Homebrew/cask/lib/hbc/locations.rb index b800cf6b6..5e18ba8fe 100644 --- a/Library/Homebrew/cask/lib/hbc/locations.rb +++ b/Library/Homebrew/cask/lib/hbc/locations.rb @@ -9,7 +9,7 @@ module Hbc::Locations end def default_caskroom - @default_caskroom ||= homebrew_repository.join("Caskroom") + @default_caskroom ||= homebrew_prefix.join("Caskroom") end def caskroom |
