-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
76 lines (63 loc) · 1.37 KB
/
setup.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
base_url() {
# echos string prefixed with base url
echo "https://raw.githubusercontent.com/fractaltechnologylabs/provisioning/master/$1"
}
installHidden() {
# downloads file from rig_setup repo
if [ $2 ]; then
mkdir -p $2
echo $2
fi
curl $(base_url $1) > ~/$2.$1
}
install() {
# downloads file from rig_setup repo
if [ $2 ]; then
mkdir -p $2
echo $2
fi
curl $(base_url $1) > ~/$2$1
}
backupHidden() {
# stores previous settings in a temp file
cp ~/$2.$1 ~/$2.$1~
}
backup() {
# stores previous settings in a temp file
cp ~/$2$1 ~/$2$1~
}
backupInstall() {
echo "Installing $1..."
if [ -f ~/$2$1 ]; then
echo "File ~/$2$1 exists. Backing it up to ~/$2$1~"
backup $1 $2
fi
install $1 $2
return 0;
}
backupInstallHidden() {
echo "Installing $1..."
if [ -f ~/$2.$1 ]; then
echo "File ~/$2.$1 exists. Backing it up to ~/$2.$1~"
backupHidden $1 $2
fi
installHidden $1 $2
return 0;
}
#
# bash settings
backupInstallHidden 'bash_profile'
backupInstallHidden 'zshrc'
# git settings
backupInstallHidden 'gitconfig'
backupInstall 'git-completion.bash'
backupInstall 'git-completion.zsh'
# vim configuration
mkdir -p ~/.vim/colors
backupInstall 'terminal_colors.vim' '.vim/colors/'
backupInstallHidden 'vimrc' ''
# backupInstallHidden 'vimrc'
source ~/.bash_profile
echo 'Installing bundles...'
vim +PluginInstall +qa
echo