aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/cache.rb
blob: 7b586528ed5ba271856d27172350afbce5a55503 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Hbc
  module Cache
    module_function

    def ensure_cache_exists
      return if Hbc.cache.exist?

      odebug "Creating Cache at #{Hbc.cache}"
      Hbc.cache.mkpath
    end

    def delete_legacy_cache
      return unless Hbc.legacy_cache.exist?

      ohai "Deleting legacy cache at #{Hbc.legacy_cache}..."
      FileUtils.remove_entry_secure(Hbc.legacy_cache)
    end
  end
end