From 46da64f7ed037ceb4c9c63874a2b28a5a63f3e71 Mon Sep 17 00:00:00 2001 From: Stephen Parkinson Date: Tue, 17 Feb 2026 21:14:24 -0800 Subject: [PATCH] use brew everywhere --- setup.sh | 45 +++++++++++++++------------------------------ zsh/zshrc | 7 ++++++- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/setup.sh b/setup.sh index f93dc8f..af72c18 100755 --- a/setup.sh +++ b/setup.sh @@ -1,36 +1,19 @@ #! /bin/bash -OSTYPE=$(uname -s) - -if [ "$OSTYPE" = "Linux" ]; then - echo "Package manager: " - read packm - if [ "$packm" = "apt" ]; then - sudo apt update - sudo apt install coreutils vim zsh jq python3 -y - sudo apt upgrade -y - elif [ "$packm" = "yum" ]; then - sudo yum update - sudo yum install coreutils vim zsh jq python3 -y - elif [ "$packm" = "pacman" ]; then - sudo pacman -Syu - sudo pacman -Sy coreutils vim zsh jq python3 +echo "Install Homebrew? [y/n]" +read homebrew +if [ "$homebrew" = "y" ]; then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo "Restore from Brewfile? [y/n]" + read bundle + if [ "$bundle" = "y" ]; then + echo "Available Brewfiles:" + ls ~/dotfiles/brew/ + echo "Brewfile name: " + read brewfile + brew bundle install --file=~/dotfiles/brew/"$brewfile" else - echo "Unknown package manager, continuing..." - fi -elif [ "$OSTYPE" = "Darwin" ]; then - mkdir -p ~/Developer - echo "Install Homebrew? [y/n]" - read homebrew - if [ "$homebrew" = "y" ]; then - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - echo "Restore from Brewfile? [y/n]" - read bundle - if [ "$bundle" = "y" ]; then - brew bundle install - else - brew install coreutils fastfetch vim zsh jq python3 - fi + brew install coreutils fastfetch vim zsh jq python3 fi fi @@ -60,6 +43,8 @@ ln -s ~/dotfiles/git/gitignore_global ~/.gitignore_global ln -s ~/dotfiles/tmux/tmux.conf ~/.tmux.conf ln -s ~/dotfiles/vim/vimrc ~/.vimrc +mkdir -p ~/Developer + echo "Change shell to zsh? [y/n]" read shell if [ "$shell" = "y" ]; then diff --git a/zsh/zshrc b/zsh/zshrc index 52889aa..c67c8fa 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -61,8 +61,13 @@ fi if [ "$(uname)" = "Darwin" ]; then # set up iterm integration [[ -f ~/.iterm2_shell_integration.zsh ]] && source ~/.iterm2_shell_integration.zsh - # source homebrew +fi + +# Homebrew (macOS: /opt/homebrew, Linux: /home/linuxbrew/.linuxbrew) +if [[ -x /opt/homebrew/bin/brew ]]; then eval "$(/opt/homebrew/bin/brew shellenv)" +elif [[ -x /home/linuxbrew/.linuxbrew/bin/brew ]]; then + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" fi # Plugins (cloned into ~/.zsh/plugins by setup.sh)