Last active
October 12, 2024 18:15
-
-
Save baquaz/510b8a702c79d00d7c9bf2a297381da1 to your computer and use it in GitHub Desktop.
Mac new machine setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Setup script for setting up a new macos machine | |
echo "Starting setup" | |
# install xcode CLI | |
xcode-select —-install | |
# Check for Homebrew to be present, install if it's missing | |
if test ! $(which brew); then | |
echo "Installing homebrew..." | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
fi | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
# Update homebrew recipes | |
brew update | |
PACKAGES=( | |
neovim | |
node | |
ripgrep | |
chruby | |
ruby-install | |
) | |
echo "Installing packages..." | |
for item in "${PACKAGES[@]}"; do | |
brew info "${item}" | grep --quiet 'Not installed' && brew install "${item}" | |
done | |
# link readline | |
#brew link --force readline | |
echo "Installing ruby" | |
ruby-install ruby 3.3.3 | |
echo "Installing Ruby gems..." | |
RUBY_GEMS=( | |
bundler | |
cocoapods | |
) | |
$HOME/.rubies/ruby-3.3.3/bin/gem install ${RUBY_GEMS[@]} | |
echo "Installing casks, apps..." | |
CASKS=( | |
iterm2 | |
visual-studio-code | |
) | |
for item in "${CASKS[@]}"; do | |
brew info "${item}" --cask | grep --quiet 'Not installed' && brew install --cask "${item}" | |
done | |
# Installing Oh-My-Posh | |
brew tap jandedobbeleer/oh-my-posh | |
brew install --cask jandedobbeleer/oh-my-posh/oh-my-posh | |
echo "Installing dev font" | |
# separate call because brew info is not in sync with fonts path | |
# to correctly check if its already installed or not | |
brew install font-meslo-lg-nerd-font --cask | |
echo "Installing Oh-My-Zsh" | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
ZSH_PLUGINS=( | |
zsh-autosuggestions | |
zsh-syntax-highlighting | |
) | |
echo "Installing ZSH plugins..." | |
for item in "${ZSH_PLUGINS[@]}"; do | |
brew info "${item}" | grep --quiet 'Not installed' && brew install "${item}" | |
done | |
echo "Macbook setup completed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment