-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
89 lines (75 loc) · 2.21 KB
/
install.sh
File metadata and controls
89 lines (75 loc) · 2.21 KB
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
#!/bin/bash
#set -x
DOT_FILES_DIR=~/.dotfiles
TMUX_FILES_DIR=~/.tmux
POWERLEVEL10K=~/.oh-my-zsh/custom/themes/powerlevel10k
usage() {
echo
echo Usage:
echo "curl https://raw.githubusercontent.com/gtam/dotfiles/master/install.sh | bash [-s help|reset]"
echo "OR"
echo "curl -L https://tinyurl.com/gtdotfiles | bash [-s help|reset]"
echo
echo "Optional parameters to show this help or to force delete the ~/.dotfiles and ~/.tmux folders."
}
if [ "$1" = "help" ]; then
usage
exit 0
fi
for i in git make
do
which $i > /dev/null
retval=$?
if [ $retval = 1 ]; then
echo
echo "Error: $i command not found, retry after install."
echo
exit 1
fi
done
if [ -d ${DOT_FILES_DIR} ] && [ "$1" = "reset" ]; then
rm -rf ${DOT_FILES_DIR}
else
if [ -d ${DOT_FILES_DIR} ]; then
echo "${DOT_FILES_DIR} already exists. Run with '| bash -s help' for help. Exiting."
exit 1
fi
fi
if [ -d ${TMUX_FILES_DIR} ] && [ "$1" = "reset" ]; then
rm -rf ${TMUX_FILES_DIR}
else
if [ -d ${TMUX_FILES_DIR} ]; then
echo "${TMUX_FILES_DIR} already exists. Run with '| bash -s help' for help. Exiting. "
exit 1
fi
fi
if [ -d ${POWERLEVEL10K} ] && [ "$1" = "reset" ]; then
rm -rf ${POWERLEVEL10K}
else
if [ -d ${POWERLEVEL10K} ]; then
echo "${POWERLEVEL10K} already exists. Run with '| bash -s help' for help. Exiting. "
exit 1
fi
fi
git clone https://github.com/gpakosz/.tmux.git ${TMUX_FILES_DIR} || {
echo "Git clone .tmux repo failed. Exiting"
exit 1
}
git clone https://github.com/tmux-plugins/tpm ${TMUX_FILES_DIR}/plugins/tpm || {
echo "Git clone tmux-plugins repo failed. Exiting"
exit 1
}
ln -s -f ~/.tmux/.tmux.conf ~/.
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k || {
echo "git clone powerlevel10k repo failed. Exiting"
exit 1
}
git clone https://github.com/gtam/dotfiles.git ${DOT_FILES_DIR} || {
echo "Git clone dotfiles repo failed. Exiting."
exit 1
}
cd ${DOT_FILES_DIR}
make install
echo ""
echo "Issue CTRL-b I to install TMUX plugins."
echo "Issue CTRL-b U to update TMUX plugins."