[Ubuntu] do not add homebrew to $PATH (#6240)

This commit is contained in:
Mikhail Koliada
2022-09-22 18:07:12 +02:00
committed by GitHub
parent 641fd77b4e
commit 9efcd841b9
4 changed files with 18 additions and 10 deletions

View File

@@ -11,14 +11,10 @@ source $HELPER_SCRIPTS/install.sh
# Install the Homebrew on Linux
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew_shellenv="/home/linuxbrew/.linuxbrew/bin/brew shellenv"
# Update /etc/environment
## Put HOMEBREW_* variables.
$brew_shellenv | grep 'export HOMEBREW' | sed -E 's/^export (.*);$/\1/' | tr -d '"' | sudo tee -a /etc/environment
# add brew executables locations to PATH
brew_path=$($brew_shellenv | grep '^export PATH' | sed -E 's/^export PATH="([^$]+)\$.*/\1/')
prependEtcEnvironmentPath "$brew_path"
# Invoke shellenv to make brew available during runnig session
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
setEtcEnvironmentVariable HOMEBREW_NO_AUTO_UPDATE 1
setEtcEnvironmentVariable HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS 3650