use brew everywhere
This commit is contained in:
29
setup.sh
29
setup.sh
@@ -1,25 +1,5 @@
|
||||
#! /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
|
||||
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
|
||||
@@ -27,12 +7,15 @@ elif [ "$OSTYPE" = "Darwin" ]; then
|
||||
echo "Restore from Brewfile? [y/n]"
|
||||
read bundle
|
||||
if [ "$bundle" = "y" ]; then
|
||||
brew bundle install
|
||||
echo "Available Brewfiles:"
|
||||
ls ~/dotfiles/brew/
|
||||
echo "Brewfile name: "
|
||||
read brewfile
|
||||
brew bundle install --file=~/dotfiles/brew/"$brewfile"
|
||||
else
|
||||
brew install coreutils fastfetch vim zsh jq python3
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Clone zsh plugins
|
||||
PLUGIN_DIR="$HOME/.zsh/plugins"
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user