homebrew install tweaks

This commit is contained in:
Matthias Kretschmann 2023-01-24 13:15:02 +00:00
parent 9b24b09040
commit 69633a35ae
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 18 additions and 13 deletions

View File

@ -1,19 +1,16 @@
#!/bin/bash
# give me /usr/local first
#sudo chown -R "$USER" /usr/local
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Make sure were using the latest Homebrew
brew update
# Upgrade any already-installed formulae
brew upgrade --all
if [[ $(uname -m) == 'arm64' ]]; then
PATH_HOMEBREW=/opt/homebrew
else
PATH_HOMEBREW=/usr/local
fi
# Install what we need
brew install \
$PATH_HOMEBREW/bin/brew install \
coreutils \
zsh \
zsh-syntax-highlighting \
@ -34,4 +31,4 @@ brew install \
clamav
# Remove outdated versions from the cellar.
brew cleanup
$PATH_HOMEBREW/bin/brew cleanup

View File

@ -54,9 +54,15 @@ echo " ✓ done$(tput sgr0)"
# ----------------------------------------------------------------------
# Switch to using brew-installed zsh as default shell
if ! grep -F -q '/opt/homebrew/bin/zsh' /etc/shells; then
echo '/opt/homebrew/bin/zsh' | sudo tee -a /etc/shells;
chsh -s /opt/homebrew/bin/zsh;
if [[ $(uname -m) == 'arm64' ]]; then
PATH_HOMEBREW=/opt/homebrew
else
PATH_HOMEBREW=/usr/local
fi
if ! grep -F -q "$PATH_HOMEBREW/bin/zsh" /etc/shells; then
echo "$PATH_HOMEBREW/bin/zsh" | sudo tee -a /etc/shells;
chsh -s $PATH_HOMEBREW/bin/zsh;
fi;
echo "$(tput setaf 64)============================================="

View File

@ -17,6 +17,8 @@ else
PATH_HOMEBREW=/usr/local
fi
export PATH_HOMEBREW
PATH_OPENSSL=$PATH_HOMEBREW/opt/openssl/bin
# PATH_RUBY=$(brew --prefix ruby)/bin
# PATH_GEMS=$PATH_HOMEBREW/lib/ruby/gems/2.6.0/bin