mirror of
https://github.com/kremalicious/dotfiles.git
synced 2024-12-22 01:03:24 +01:00
homebrew install tweaks
This commit is contained in:
parent
9b24b09040
commit
69633a35ae
@ -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 we’re 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
|
||||
|
@ -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)============================================="
|
||||
|
Loading…
Reference in New Issue
Block a user