Last active
May 26, 2023 08:55
-
-
Save barzik/83e8fae9dd3308d29ff77920428b7f00 to your computer and use it in GitHub Desktop.
My favorite mac programs
This file contains 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 | |
# Install Oh My Zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# Reload Oh My Zsh | |
exec zsh | |
# Function to check if a command is installed | |
check_command_installed() { | |
if ! command -v "$1" &> /dev/null; then | |
echo "Error: $1 is not installed or not found." | |
exit 1 | |
fi | |
} | |
# Install Xcode Command Line Tools | |
xcode-select --install | |
# Check Xcode installation | |
check_command_installed "xcode-select" | |
# Install Homebrew | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
# Check Homebrew installation | |
check_command_installed "brew" | |
# Install iTerm2 | |
brew install --cask iterm2 | |
# Check iTerm2 installation | |
check_command_installed "iterm2" | |
# Install Docker | |
brew install --cask docker | |
# Check Docker installation | |
check_command_installed "docker" | |
# Install nvm with the latest Node.js version | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash | |
source ~/.zshrc | |
nvm install node | |
# Check nvm installation | |
check_command_installed "nvm" | |
# Install pyenv and the latest Python version | |
brew install pyenv | |
echo 'eval "$(pyenv init --path)"' >> ~/.zshrc | |
echo 'eval "$(pyenv init -)"' >> ~/.zshrc | |
exec "$SHELL" | |
pyenv install $(pyenv install --list | grep -v - | tail -1) | |
# Check pyenv installation | |
check_command_installed "pyenv" | |
# Install Poetry | |
curl -sSL https://install.python-poetry.org | python3 - | |
# Check Poetry installation | |
check_command_installed "poetry" | |
# Prompt for installing Visual Studio Code and/or PyCharm | |
read -p "Do you want to install Visual Studio Code? (y/n): " install_vscode | |
read -p "Do you want to install PyCharm? (y/n): " install_pycharm | |
# Install Visual Studio Code | |
if [[ "$install_vscode" == "y" || "$install_vscode" == "Y" ]]; then | |
brew install --cask visual-studio-code | |
# Check Visual Studio Code installation | |
check_command_installed "code" | |
fi | |
# Install PyCharm | |
if [[ "$install_pycharm" == "y" || "$install_pycharm" == "Y" ]]; then | |
brew install --cask pycharm | |
# Check PyCharm installation | |
check_command_installed "pycharm" | |
fi | |
echo "Installation completed successfully." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment