mirror of
https://github.com/Homebrew/install.git
synced 2026-01-09 05:41:07 +08:00
install.sh: check for file that prevents Homebrew installation.
Add support for a `/etc/homebrew/brew.no_install` file that can be used to prevent running the Homebrew installation script and optionally provide a message to the user.
This commit is contained in:
parent
e831048c83
commit
956abfa01f
12
install.sh
12
install.sh
@ -39,6 +39,18 @@ then
|
||||
abort 'Bash must not run in POSIX mode. Please unset POSIXLY_CORRECT and try again.'
|
||||
fi
|
||||
|
||||
# Check for file that prevents Homebrew installation
|
||||
if [[ -f "/etc/homebrew/brew.no_install" ]]
|
||||
then
|
||||
BREW_NO_INSTALL="$(cat "/etc/homebrew/brew.no_install" 2>/dev/null)"
|
||||
if [[ -n "${BREW_NO_INSTALL}" ]]
|
||||
then
|
||||
abort "Homebrew cannot be installed because ${BREW_NO_INSTALL}."
|
||||
else
|
||||
abort "Homebrew cannot be installed because /etc/homebrew/brew.no_install exists!"
|
||||
fi
|
||||
fi
|
||||
|
||||
# string formatters
|
||||
if [[ -t 1 ]]
|
||||
then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user