Skip to content

Instantly share code, notes, and snippets.

@malash
Created August 27, 2023 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malash/536dcd4d960d9358199f71d19e0c2a10 to your computer and use it in GitHub Desktop.
Save malash/536dcd4d960d9358199f71d19e0c2a10 to your computer and use it in GitHub Desktop.
`/opt/homebrew`'s patch to fix compatible with `proxychains-ng` on macOS Ventuna
diff --git a/bin/brew b/bin/brew
index 6e4416259..c8ddcc6e2 100755
--- a/bin/brew
+++ b/bin/brew
@@ -198,12 +198,13 @@ then
fi
# filter the user environment
-PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+PATH="/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
FILTERED_ENV=()
ENV_VAR_NAMES=(
HOME SHELL PATH TERM TERMINFO TERMINFO_DIRS COLUMNS DISPLAY LOGNAME USER CI SSH_AUTH_SOCK SUDO_ASKPASS
http_proxy https_proxy ftp_proxy no_proxy all_proxy HTTPS_PROXY FTP_PROXY ALL_PROXY
+ DYLD_FORCE_FLAT_NAMESPACE DYLD_INSERT_LIBRARIES PROXYCHAINS_CONF_FILE PROXYCHAINS_QUIET_MODE
)
# Filter all but the specific variables.
for VAR in "${ENV_VAR_NAMES[@]}" "${!HOMEBREW_@}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment