-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
144 lines (120 loc) · 5.23 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/usr/bin/env bash
set -e
exists() {
type "$1" &>/dev/null
}
sudo apt update
sudo apt install build-essential procps curl file git -y
sudo apt install zsh -y || echo "Failed to install zsh"
OHMYZSH="~/.oh-my-zsh"
if [ ! -d "$OHMYZSH" ]; then
echo "----------------------------"
echo " Installing ohmyzsh "
echo "----------------------------"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended || echo "Failed to install ohmyzsh"
fi
ZSH_CUSTOM="$OHMYZSH/custom"
SPACESHIP="$OHMYZSH/custom/themes/spaceship-prompt"
if [ ! -d "$SPACESHIP" ]; then
echo "----------------------------"
echo " Cloning spaceship theme "
echo "----------------------------"
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
fi
ZSHPLUGINS=("zsh-autosuggestions" "zsh-completions")
for p in ${ZSHPLUGINS[@]}; do
if [ ! -d "$ZSH_CUSTOM/plugins/$p" ]; then
echo "--------------------------------------"
echo "Cloning $p plugin"
echo "--------------------------------------"
git clone https://github.com/zsh-users/"$p" ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/"$p"
fi
done
echo "-------------------------------------------------"
echo "Cloning fast-syntax-highlighting plugin"
echo "-------------------------------------------------"
git clone https://github.com/zdharma/fast-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
if ! exists brew; then
echo "Installing homebrew..."
echo "This may take a while"
echo "Installing requirements for homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" || echo "Failed to install homebrew"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >>/home/joaom/.zprofile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
if ! exists nvm; then
echo "----------------------------"
echo " Cloning ZSH-NVM "
echo "----------------------------"
git clone https://github.com/lukechilds/zsh-nvm.git ~/.zsh-nvm
fi
if ! exists yarn; then
echo "----------------------------"
echo " Installing yarn "
echo "----------------------------"
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install --no-install-recommends yarn || echo "Failed to install yarn"
fi
if exists brew; then
echo "-------------------Homebrew Install----------------------"
echo " "
echo " Neovim "
echo " "
echo "---------------------------------------------------------"
brew install --HEAD luajit
brew install --HEAD neovim
echo "-------------------Homebrew Install----------------------"
echo " "
echo " Github CLI "
echo " "
echo "---------------------------------------------------------"
brew install gh
echo "-------------------Homebrew Install----------------------"
echo " "
echo " Lazydocker "
echo " "
echo "---------------------------------------------------------"
brew install lazydocker
fi
echo "----------------------------"
echo " Installing rust "
echo "----------------------------"
curl https://sh.rustup.rs -sSf | sh
if exists cargo; then
echo "---------------------Cargo Install-----------------------"
echo " Stylua "
echo "---------------------------------------------------------"
cargo install stylua
echo "---------------------Cargo Install-----------------------"
echo " Delta "
echo "---------------------------------------------------------"
cargo install git-delta
if ! exists rg; then
echo "---------------------Cargo Install-----------------------"
echo " Ripgrep "
echo "---------------------------------------------------------"
cargo install ripgrep
fi
fi
echo "Dotfiles -------------------------------------------------"
export DOTFILES="$HOME/.dotfiles"
if [ -d "$DOTFILES" ]; then
echo "Dotfiles have already been cloned into the home dir"
else
echo "Cloning dotfiles"
git clone https://github.com/joaom00/dotfiles.git ~/.dotfiles
fi
cd "$DOTFILES" || "Didn't cd into dotfiles this will be bad :("
git submodule update --init --recursive
echo "---------------------------------------------------------"
echo "Changing to zsh"
echo "---------------------------------------------------------"
chsh -s "$(which zsh)"
$DOTFILES/install
echo "---------------------------------------------------------"
echo "All done!"
echo "Cheers"
echo "---------------------------------------------------------"
exit 0