Skip to content

Instantly share code, notes, and snippets.

@DawnBreather
Last active May 19, 2023 14:40
Show Gist options
  • Save DawnBreather/2d87b75e82ef3ea17e165cb0f00cf3a4 to your computer and use it in GitHub Desktop.
Save DawnBreather/2d87b75e82ef3ea17e165cb0f00cf3a4 to your computer and use it in GitHub Desktop.
MacOS: tools bootstrap
  1. Open Terminal: Press Cmd+Space to open Spotlight, type "Terminal," and press Enter.
  2. Copy the script: Copy the script below:
/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/DawnBreather/2d87b75e82ef3ea17e165cb0f00cf3a4/raw/f868fa4a313bbb7312261a0374589732c884e23e/install.sh)"
  1. Paste and run: In Terminal, paste the script using Cmd+V and press Enter. If prompted, enter your password and press Enter again.
  2. Wait for completion
  3. Verify installation: Press Cmd+Space and type the application names (e.g., "Zoom" or "Slack") to ensure they've been installed.
#!/bin/bash
check_macos_version() {
min_version="10.15"
current_version=$(sw_vers -productVersion)
if [[ $(printf '%s\n' "$min_version" "$current_version" | sort -V | head -n1) == "$min_version" ]]; then
return 0
else
return 1
fi
}
check_app_installed() {
app_names=("$@")
for app_name in "${app_names[@]}"; do
app_path="/Applications/$app_name.app"
app_name_lower=$(echo "$app_name" | tr '[:upper:]' '[:lower:]')
for dir_entry in /Applications/*.app; do
dir_entry_lower=$(basename "$dir_entry" | tr '[:upper:]' '[:lower:]')
if [[ "$app_name_lower.app" == "$dir_entry_lower" ]]; then
return 0
fi
done
done
return 1
}
if ! check_macos_version; then
echo "Your macOS version is not supported. The minimum required version is 10.15."
exit 1
fi
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
if ! check_app_installed "Zoom" "Zoom.us"; then
brew install --cask zoom
fi
if ! check_app_installed "Slack"; then
brew install --cask slack
fi
if ! check_app_installed "Visual Studio Code" "VSCode"; then
brew install --cask visual-studio-code
fi
if ! check_app_installed "iTerm" "iTerm2"; then
brew install --cask iterm2
fi
/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/DawnBreather/2d87b75e82ef3ea17e165cb0f00cf3a4/raw/f868fa4a313bbb7312261a0374589732c884e23e/install.sh)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment