diff options
| author | Martin Afanasjew | 2016-02-04 14:46:31 +0100 |
|---|---|---|
| committer | Martin Afanasjew | 2016-02-05 22:07:07 +0100 |
| commit | 5f049637d9efab6d4433c34b6f7023cf9cd288d1 (patch) | |
| tree | b24759a9a0f14804377b3b4c382a9e83eed0b766 /Library/ENV/scm/git | |
| parent | f9efa18be146dc4372ac9c7a3a60ec1ad14cbd46 (diff) | |
| download | brew-5f049637d9efab6d4433c34b6f7023cf9cd288d1.tar.bz2 | |
ENV: protect against environment being reset
We cannot really recover from this, but at least we'll provide a clearer
error message than trying to call `exec` with an empty string.
Diffstat (limited to 'Library/ENV/scm/git')
| -rwxr-xr-x | Library/ENV/scm/git | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/ENV/scm/git b/Library/ENV/scm/git index 6124ffe5f..6d13a33a3 100755 --- a/Library/ENV/scm/git +++ b/Library/ENV/scm/git @@ -2,6 +2,11 @@ # Make sure this shim uses the same Ruby interpreter that is used by Homebrew. unset RUBYLIB unset RUBYOPT +if [ -z "$HOMEBREW_RUBY_PATH" ] +then + echo "${0##*/}: The build tool has reset ENV; --env=std required." >&2 + exit 1 +fi exec "$HOMEBREW_RUBY_PATH" -x "$0" "$@" #!/usr/bin/env ruby -W0 |
