From 5a674c232f156ff6a66e78594b8c1167c45c817a Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Thu, 21 Dec 2023 21:39:58 -0800 Subject: [PATCH] Fix Cask::Cask.all bug We were only loading casks from files with this command which, of course, didn't work for casks that can only be loaded from the API (when the core cask tap is not tapped). This changes things to align more with what we do for formulae. --- Library/Homebrew/cask/cask.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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