-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·75 lines (59 loc) · 1.58 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env bash
set -e
IS_OSX=false
[[ $OSTYPE == 'darwin'* ]] && IS_OSX=true
if type brew &> /dev/null; then
brew update
else
echo "Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [ "$IS_OSX" = false ]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
fi
if [ "$IS_OSX" = true ]; then
. ./iterm2/install.sh
fi
if ! type fzf &> /dev/null; then
echo "Installing fzf"
brew install fzf
fi
if ! type zplug &> /dev/null; then
echo "Installing ZPlug"
brew install zplug
fi
if ! type tmux &> /dev/null; then
echo "Installing tmux"
brew install tmux tmuxinator
git clone https://github.com/tmux-plugins/tpm "$HOME/.tmux/plugins/tpm"
fi
if ! type nvim &> /dev/null; then
echo "Installing Neovim"
brew install neovim
git clone https://github.com/p-m-p/nvim-config.git "$HOME/.config/nvim"
fi
if ! brew --prefix --installed sdkman-cli &> /dev/null; then
echo "Installing SDKMAN"
brew tap sdkman/tap
brew install sdkman-cli
fi
if ! type podman &> /dev/null; then
echo "Installing Podman"
brew install podman podman-compose
if [ "$IS_OSX" = true ]; then
podman machine init
podman machine start
brew install --cask podman-desktop
fi
fi
for dotfile in ./dotfiles/*
do
FILE_NAME=$(basename "$dotfile")
FILE_PATH="$HOME/.$FILE_NAME"
if [ -f "$FILE_PATH" ]; then
echo "$FILE_PATH exists: backing up to $FILE_PATH.bak"
mv "$FILE_PATH" "$FILE_PATH.bak"
fi
cp "$dotfile" "$FILE_PATH"
done
echo "Install complete, now 'source ~/.zshrc' and run 'setup.sh'"