-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·68 lines (52 loc) · 1.31 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
#!/usr/bin/env bash
CURRENT_DIRECTORY=$(pwd)
UPDATED="no"
runUpdate() {
if [ $UPDATED = "no" ]; then
apt-get update
UPDATED="yes"
fi
}
[ -e /usr/bin/curl ]
HAS_CURL=$?
if [ $HAS_CURL != 0 ]; then
runUpdate
apt-get install -y curl
fi
[ -e /usr/bin/git ]
HAS_GIT=$?
if [ $HAS_GIT != 0 ]; then
runUpdate
apt-get install -y git
fi
[ -e /usr/bin/zsh ]
HAS_ZSH=$?
if [ $HAS_ZSH != 0 ]; then
runUpdate
apt-get install -y zsh
fi
[ -d $HOME/.oh-my-zsh ]
HAS_OH_MY_ZSH=$?
if [ $HAS_OH_MY_ZSH != 0 ]; then
yes Y | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
THEME_DIR=$HOME/.oh-my-zsh/custom/themes
[ -d $THEME_DIR/spaceship-prompt ]
HAS_THEME=$?
if [ $HAS_THEME != 0 ]; then
git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$THEME_DIR/spaceship-prompt" --depth=1
ln -s "$THEME_DIR/spaceship-prompt/spaceship.zsh-theme" "$THEME_DIR/spaceship.zsh-theme"
fi
[ -d $HOME/.nvm ]
HAS_NVM=$?
if [ $HAS_NVM != 0 ]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
fi
[ -d $HOME/antigen.zsh ]
HAS_ANTIGEN=$?
if [ $HAS_ANTIGEN != 0 ]; then
curl -L git.io/antigen >$HOME/antigen.zsh
fi
mv $HOME/.zshrc $HOME/.zshrc.backup
ln -s $CURRENT_DIRECTORY/.zshrc $HOME/.zshrc
zsh