From ba0bc88b3d014f90a3342350b29804ec6d0ce1a1 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Thu, 28 Aug 2025 11:21:57 -0400 Subject: [PATCH] AbstractUninstall: coerce which argument to String `Cask::Artifact::AbstractUninstall.uninstall_script` contains a `which` call that uses a `Pathname` argument instead of a `String` and this leads to a type error (`Parameter 'cmd': Expected type String, got type Pathname with value...`). This resolves the error by calling `#to_s` on the `executable_path` argument. --- Library/Homebrew/cask/artifact/abstract_uninstall.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 7426e0f09d..62a78986eb 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -376,7 +376,7 @@ module Cask executable_path = staged_path_join_executable(executable) if (executable_path.absolute? && !executable_path.exist?) || - (!executable_path.absolute? && (which executable_path).nil?) + (!executable_path.absolute? && which(executable_path.to_s).nil?) message = "uninstall script #{executable} does not exist" raise CaskError, "#{message}." unless force