Last active
June 23, 2025 18:16
-
-
Save KZeronimo/8816ca472c3745a95ad35386ae2da5e5 to your computer and use it in GitHub Desktop.
Brew based Boxstarter Script - Bootstrap - OS X
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 | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| function cleanup { | |
| echo "Cleaning up temporary files..." | |
| [ -d "$targetPath/PostBuildContent-master" ] && rm -rf "$targetPath/PostBuildContent-master" | |
| [ -f "$HOME/PostBuildContent.zip" ] && rm -f "$HOME/PostBuildContent.zip" | |
| } | |
| function finish { | |
| cleanup | |
| echo "Bootstrap completed. Starting new shell session..." | |
| exec zsh -l | |
| } | |
| trap finish EXIT | |
| trap 'echo "Script interrupted. Cleaning up..."; cleanup; exit 1' SIGINT SIGTERM SIGHUP | |
| if ! [[ $(command -v brew) ]]; then | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| fi | |
| if ! grep -wiq 'eval "\$(/opt/homebrew/bin/brew shellenv)"' "$HOME/.zprofile"; then | |
| echo 'Adding brew to .zprofile' | |
| echo >> $HOME/.zprofile | |
| echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| fi | |
| # Get Post Build Content | |
| echo "Getting post build content" | |
| targetPath="$HOME/_PostBuildContent" | |
| if [ -d "$targetPath" ]; then | |
| echo "Removing previous $targetPath" | |
| rm -rf "$targetPath" | |
| fi | |
| curl -o "$HOME/PostBuildContent.zip" -L https://github.com/KZeronimo/PostBuildContent/archive/refs/heads/master.zip | |
| unzip "$HOME/PostBuildContent.zip" -d "$targetPath" | |
| mv "$targetPath/PostBuildContent-master/"* "$targetPath" | |
| answersPath="/tmp/User_Answers.json" | |
| if [ -f "$answersPath" ]; then | |
| cp "$answersPath" "$targetPath/User_Answers.json" | |
| fi | |
| # Install fonts if not already installed | |
| for font in font-caskaydia-cove-nerd-font font-caskaydia-mono-nerd-font font-sauce-code-pro-nerd-font; do | |
| if brew list --cask "$font" &>/dev/null; then | |
| echo "Font $font is already installed, skipping..." | |
| else | |
| echo "Installing font: $font" | |
| brew install --cask "$font" | |
| fi | |
| done | |
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended | |
| brew install \ | |
| azure-cli \ | |
| azure/functions/azure-functions-core-tools@4 \ | |
| dapr/tap/dapr-cli \ | |
| helm \ | |
| jq \ | |
| linkerd \ | |
| powerlevel10k \ | |
| shellcheck | |
| echo 'Source powerlevel10k' | |
| echo "source $(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc | |
| brew install --cask \ | |
| git-credential-manager \ | |
| docker \ | |
| google-chrome \ | |
| iterm2 \ | |
| microsoft-azure-storage-explorer \ | |
| microsoft-edge \ | |
| postman \ | |
| powershell \ | |
| visual-studio-code \ | |
| wireshark | |
| # Create root folder structure | |
| echo "Creating root folder structure" | |
| mkdir -p "$HOME/_Src" | |
| mkdir -p "$HOME/_Src/Prod" | |
| mkdir -p "$HOME/_Src/Prod/Mesh" | |
| mkdir -p "$HOME/_Src/Sdbx" | |
| # Clone OneFlow Repo | |
| echo "Checking for OneFlow repo" | |
| cd "$HOME/_Src/Prod/Mesh" | |
| repo_url="https://[email protected]/meshsystems/Mesh%20Systems/_git/Mesh.DevAutomation.OneFlow" | |
| repo_name=$(basename "$repo_url" | sed 's/%20/ /g') | |
| if [ ! -d "$repo_name" ]; then | |
| echo "Cloning OneFlow repo" | |
| git clone "$repo_url" | |
| fi | |
| # Clone DotNet Templates Repo | |
| echo "Checking for DotNet Templates repo" | |
| cd "$HOME/_Src/Prod/Mesh" | |
| repo_url="https://[email protected]/meshsystems/Mesh%20Systems/_git/Mesh.DotNet.Templates" | |
| repo_name=$(basename "$repo_url" | sed 's/%20/ /g') | |
| if [ ! -d "$repo_name" ]; then | |
| echo "Cloning DotNet Templates repo" | |
| git clone "$repo_url" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment