-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·50 lines (41 loc) · 1.54 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/bash
if [[ $SPIN ]]; then
git config --global user.email "[email protected]"
git config --global user.name "Ben Kovacs"
git config --global --unset-all credential.helper
fi
if [[ ! -d "$HOME/.oh-my-zsh" ]]; then
# install oh my zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
if [[ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]]; then
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
fi
if [[ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" ]]; then
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
fi
ln -sf ~/dotfiles/dotfiles/.zshrc ~/.zshrc
ln -sf ~/dotfiles/dotfiles/.gitconfig ~/.gitconfig
ln -sf ~/dotfiles/dotfiles/.config/nvim ~/.config/nvim
if command -v rg &> /dev/null
then
echo "ripgrep is already installed."
else
echo "ripgrep is not installed. Installing now..."
# Check if Homebrew is installed
if command -v brew &> /dev/null
then
echo "Homebrew is installed. Proceeding with the installation..."
brew install ripgrep
# Check if apt-get is installed
elif command -v apt-get &> /dev/null
then
echo "apt-get is installed. Proceeding with the installation..."
sudo apt-get update
sudo apt-get install -y ripgrep
else
echo "Neither Homebrew nor apt-get is available on this system. Please install one of them first."
exit 1
fi
fi
exit 0