diagnostic: fix XDG_DATA_DIRS check

Pass `XDG_DATA_DIRS` through `bin/brew` so that it can be checked.
This commit is contained in:
Adrian Ho 2024-08-03 11:29:04 +08:00 committed by Mike McQuaid
parent 78132b13bf
commit 3eaebdc9d8
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View File

@ -60,8 +60,8 @@ module Homebrew
end end
def check_xdg_data_dirs def check_xdg_data_dirs
xdg_data_dirs = ENV.fetch("XDG_DATA_DIRS", nil) xdg_data_dirs = ENV.fetch("HOMEBREW_XDG_DATA_DIRS", nil)
return if xdg_data_dirs.blank? || xdg_data_dirs.split("/").include?(HOMEBREW_PREFIX/"share") return if xdg_data_dirs.blank? || xdg_data_dirs.split(":").include?(HOMEBREW_PREFIX/"share")
<<~EOS <<~EOS
Homebrew's share was not found in your XDG_DATA_DIRS but you have Homebrew's share was not found in your XDG_DATA_DIRS but you have

View File

@ -185,6 +185,7 @@ USED_BY_HOMEBREW_VARS=(
SUDO_USER SUDO_USER
TMUX TMUX
XDG_CACHE_HOME XDG_CACHE_HOME
XDG_DATA_DIRS
XDG_RUNTIME_DIR XDG_RUNTIME_DIR
ZDOTDIR ZDOTDIR
) )