diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index 2ebf119e60..04051e5e93 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -30,8 +30,11 @@ module Cask raise ArgumentError, "Cask::Cask#all cannot be used without --eval-all or HOMEBREW_EVAL_ALL" end - Tap.flat_map(&:cask_files).map do |f| - CaskLoader::FromTapPathLoader.new(f).load(config: nil) + # Load core casks from tokens so they load from the API when the core cask is not tapped. + tokens_and_files = CoreCaskTap.instance.cask_tokens + tokens_and_files += Tap.reject(&:core_cask_tap?).flat_map(&:cask_files) + tokens_and_files.map do |token_or_file| + CaskLoader.load(token_or_file) rescue CaskUnreadableError => e opoo e.message