-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
brew.env does not support expansion or substitution #16027
Comments
This was done on purpose for security reasons. The original implementation used eval (#15787) but we later moved to using Bash builtins to help avoid potential security problems (#15821). We should probably just try expanding environment variables in paths. That being said I don't think there is an easy way to do that without eval in Bash or Ruby. Python has a builtin method There also are probably some ways to escape/quote the Bash code to make eval less unsafe but I'm no Bash expert. |
I think we could probably support
I don't think we can/should support running arbitrary commands in this situation, sorry.
Agreed. I don't think it's worth making this more complex for that reason. If we want to add complexity: we should probably have a The solution for now I'd say is just to use your shell profile instead, sorry! |
@MikeMcQuaid that's fine. Could the man page be updated to reflect the limitation. It would have helped me to have known. |
@dkav Where would you expect to have found this information? |
Somewhere around here: Line 2069 in f1d345a
brew.env .
|
brew doctor
outputVerification
brew doctor
output" above saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
twice and am still able to reproduce my issue.brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.brew config
outputWhat were you trying to do (and why)?
I was trying to setup brew.env in a similar fashion as my shell profile using expansion in the
HOMEBREW_BUNDLE_FILE
and substitution in theHOMEBREW_GITHUB_API_TOKEN
.What happened (include all command output)?
For HOMEBREW_BUNDLE_FILE=$HOME/.homebrew/Brewfile
Error: No such file or directory @ rb_sysopen - /Users/dkav/$HOME/.homebrew/Brewfile/
For HOMEBREW_GITHUB_API_TOKEN=$( cat ~/.token/homebrew_github_api_token ) the error was:
Error: GitHub API Error: Bad credentials
and the debug output:
\%\{http_code\} --header Authorization:\ token\ \$\(\ cat\ \~/.token/homebrew_github_api_token\ \)
What did you expect to happen?
For both HOMEBREW_BUNDLE_FILE and HOMEBREW_GITHUB_API_TOKEN I expected expansion and substitution respectively to work as in a standard Bash script.
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: