-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·80 lines (66 loc) · 1.8 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
#!/bin/bash
#########################################
### Bash script location ###
#########################################
realpath() {
OURPWD=$PWD
cd "$(dirname "$1")"
LINK=$(readlink "$(basename "$1")")
while [ "$LINK" ]; do
cd "$(dirname "$LINK")"
LINK=$(readlink "$(basename "$1")")
done
REALPATH="$PWD/$(basename "$1")"
cd "$OURPWD"
echo "$REALPATH"
}
# current script command line call
#Work for GNU Linux and BSD and MacOSX
scriptCall="$(realpath "${BASH_SOURCE[0]}")"
# only work on GNU Linux
#scriptCall="$(readlink -f ${BASH_SOURCE[0]})"
# directory of the script
scriptDir=$(dirname "$scriptCall")
# script base name
scriptName=$(basename "$scriptCall")
#########################################
### OS basic detection ###
#########################################
case "$OSTYPE" in
linux*)
currentOS="linux";;
darwin*)
currentOS="macosx";;
solaris*)
currentOS="solaris";;
cygwin)
currentOS="windows";;
win*)
currentOS="windows";;
freebsd*)
currentOS="bsd";;
bsd*)
currentOS="bsd";;
*)
currentOS="unknown";;
esac
########################################
### Main program ###
########################################
# install dependencies
sudo apt-get install -y git vim screen tmux ack-grep zsh
cd $scriptDir/home
cp -R -u -v . ~/
cd $scriptDir
# install Vundle : VIM bundle manager
if [ ! -d ~/.vim/bundle/Vundle.vim ];then
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
# install vim plugins by vundle
vim +PluginInstall +qall
# install OH my ZSH
if [ ! -d ~/.oh-my-zsh ]; then
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
fi
# Copy oh-my-zsh theme
cp -R -u -v $scriptDir/home/.oh-my-zsh ~/