use brew everywhere

This commit is contained in:
2026-02-17 21:14:24 -08:00
parent 76aaedc3f9
commit 46da64f7ed
2 changed files with 21 additions and 31 deletions

View File

@@ -1,36 +1,19 @@
#! /bin/bash #! /bin/bash
OSTYPE=$(uname -s) echo "Install Homebrew? [y/n]"
read homebrew
if [ "$OSTYPE" = "Linux" ]; then if [ "$homebrew" = "y" ]; then
echo "Package manager: " /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
read packm echo "Restore from Brewfile? [y/n]"
if [ "$packm" = "apt" ]; then read bundle
sudo apt update if [ "$bundle" = "y" ]; then
sudo apt install coreutils vim zsh jq python3 -y echo "Available Brewfiles:"
sudo apt upgrade -y ls ~/dotfiles/brew/
elif [ "$packm" = "yum" ]; then echo "Brewfile name: "
sudo yum update read brewfile
sudo yum install coreutils vim zsh jq python3 -y brew bundle install --file=~/dotfiles/brew/"$brewfile"
elif [ "$packm" = "pacman" ]; then
sudo pacman -Syu
sudo pacman -Sy coreutils vim zsh jq python3
else else
echo "Unknown package manager, continuing..." brew install coreutils fastfetch vim zsh jq python3
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
fi fi
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/tmux/tmux.conf ~/.tmux.conf
ln -s ~/dotfiles/vim/vimrc ~/.vimrc ln -s ~/dotfiles/vim/vimrc ~/.vimrc
mkdir -p ~/Developer
echo "Change shell to zsh? [y/n]" echo "Change shell to zsh? [y/n]"
read shell read shell
if [ "$shell" = "y" ]; then if [ "$shell" = "y" ]; then

View File

@@ -61,8 +61,13 @@ fi
if [ "$(uname)" = "Darwin" ]; then if [ "$(uname)" = "Darwin" ]; then
# set up iterm integration # set up iterm integration
[[ -f ~/.iterm2_shell_integration.zsh ]] && source ~/.iterm2_shell_integration.zsh [[ -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)" eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -x /home/linuxbrew/.linuxbrew/bin/brew ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi fi
# Plugins (cloned into ~/.zsh/plugins by setup.sh) # Plugins (cloned into ~/.zsh/plugins by setup.sh)