-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·190 lines (164 loc) · 5.89 KB
/
index.html
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# vim: set ft=sh:
{ # this ensures the entire script is downloaded #
# Source the utility functions
if [ -d ~/dotfiles ]; then
source ~/dotfiles/utils/utils.sh
source ~/dotfiles/utils/install_bashrc.sh
source ~/dotfiles/utils/basic_tools.sh
source ~/dotfiles/utils/compile_vim.sh
source ~/dotfiles/utils/compile_cmake.sh
source ~/dotfiles/utils/compile_ycm.sh
fi
# ###################################################################
# MAIN
# ###################################################################
function main() {
clear
define_colors
banner
ech "\nSetting Up..." 2
ech "----------------------------------------------------------------------------" 2
# We need certain functions to run in this file, then we grab the others
basic_setup
# Source the utility functions
if [ -d ~/dotfiles ]; then
source ~/dotfiles/utils/utils.sh
source ~/dotfiles/utils/install_bashrc.sh
source ~/dotfiles/utils/basic_tools.sh
source ~/dotfiles/utils/compile_vim.sh
source ~/dotfiles/utils/compile_cmake.sh
source ~/dotfiles/utils/compile_ycm.sh
fi
ech "\nInstalling bash..." 2
ech "----------------------------------------------------------------------------" 2
install_bashrc
ech "\nInstall completed.\n\n" 2
ech "Please run 'source ~/.bashrc'\n\n" 2
update_vimrc
}
# ###################################################################
# ###################################################################
# MUST EXIST IN HERE BECAUSE OF INITAL DOWNLOAD
# ###################################################################
# ###################################################################
# SETUP, GIT, ADD THE REPO
# ###################################################################
function basic_setup() {
tools="curl build-essential git bc dtrx ncdu htop trash-cli tmux bash-completion tig ctags cmake"
# silversearcher-ag
mactools="curl build-essential git bc dtrx ncdu htop trash-cli the_silver_searcher tmux vim ctags"
define_colors
if isosx; then
which -s brew
if [[ $? != 0 ]]; then
ech "- Installing Homebrew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
ech "- Install Tools..."
brew install --quieter $mactools &> /dev/null
ech "- Install iTerm2 Profile..."
# Specify the preferences directory
defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/dotfiles/iterm2"
# Tell iTerm2 to use the custom preferences in the directory
defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true
fi
# LINUX BASICS
# #############################################################
if islinux; then
ech "- APT update..."
sudo apt-get update
ech "- Install Tools.."
sudo apt-get install $tools -y
fi
# GET REPO
# #############################################################
if [ ! -d ~/dotfiles ]; then
ech "- Cloning dotfiles..."
git clone --quiet https://github.com/ryan-frankel/dotfiles ~/dotfiles
cd ~/dotfiles
else
ech "- Pulling dotfiles..."
cd ~/dotfiles
git pull --quiet origin master
fi
}
# DEFINE BANNER
# ###################################################################
function banner() {
echo -e "${DARKGRAY}"
echo -e ".8888b dP dP dP "
echo -e "88 ' 88 88 88 "
echo -e "88aaa 88d888b. .d8888b. 88d888b. 88 .dP .d8888b. 88 .d8888b. 88d888b. "
echo -e "88 88' '88 88' '88 88' '88 88888' 88ooood8 88 Y8ooooo. 88' '88 "
echo -e "88 88 88. .88 88 88 88 '8b. 88. ... 88 88 88 88 "
echo -e "dP dP '88888P8 dP dP dP 'YP '88888P' dP 88 '88888P' dP dP "
echo -e "----------------------------------------------------------------------------"
echo -e "${CURSOR}"
}
# DEFINE COLORS
# ###################################################################
function define_colors {
GREEN="\033[38;05;70m"
PURPLE="\033[38;05;93m"
LIGHTPURPLE="\033[38;05;105m"
LIGHTGRAY="\033[38;05;248m"
DARKGRAY="\033[38;05;236m"
CURSOR="\033[00m";
CURSOR="${LIGHTGRAY}"
}
# FUNCTION FOR ECHO WITH COLOR OPTION
# ###################################################################
function ech() {
if [ -z "$2" ]; then
echo -e " ${GREEN}$1${CURSOR}";
else
echo -e "${CURSOR}$1${CURSOR}";
fi
}
# FUNCTION TO TEST FOR OSX/LINUX/ETC
# ###################################################################
function isosx() {
if [[ $OSTYPE == *"darwin"* ]]; then
return 0; # true
else
return 1; # false
fi
}
function islinux() {
if [[ $OSTYPE == *"linux"* ]]; then
return 0; # true
else
return 1; # false
fi
}
# MAIN CLI Function
# ###################################################################
# At bottom so all functions are defined when this is run
if [ "$1" == "--help" ]; then
echo "vim - compile vim and install all bundles"
echo "updatevim - Updates vim bundles and vimrc"
echo "cmake - install new version of cmake"
echo "ycm - install youcompleteme"
echo "tools - install basic tools"
echo "all - INSTALL ALL THE ABOVE"
elif [ "$1" == "updatevim" ]; then
update_vimrc
elif [ "$1" == "vim" ]; then
compile_vim
update_vimrc
elif [ "$1" == "cmake" ]; then
compile_cmake
elif [ "$1" == "ycm" ]; then
compile_ycm
elif [ "$1" == "tools" ]; then
basic_tools
elif [ "$1" == "all" ]; then
basic_tools
compile_cmake
compile_vim
update_vimrc
compile_ycm
else
main
fi
} # this ensures the entire script is downloaded #