From d0e438c5fafc3e8d11e94f1912d77ef91fa7257a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Lach?= Date: Sun, 3 Nov 2024 13:29:47 +0100 Subject: [PATCH] Downcase internal commands Since APFS is case-insensitive by default, Ruby will load the command file if user passes it mixed-case, but invoking it later will fail. --- Library/Homebrew/brew.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index dbe7acc210..8a68f37df6 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -83,7 +83,10 @@ begin end if internal_cmd || Commands.external_ruby_v2_cmd_path(cmd) - cmd = T.must(cmd) + # All internal commands are downcased + # Since APFS is case-insensitive by default, Ruby will load the command file + # if user passes it mixed-case, but here invoking it will fail. + cmd = T.must(cmd).downcase cmd_class = Homebrew::AbstractCommand.command(cmd) Homebrew.running_command = cmd if cmd_class