-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup
executable file
·60 lines (55 loc) · 1.37 KB
/
setup
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
#!/bin/bash
# use colors, but only if connected to a terminal, and that terminal
# supports them.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi
if [ ! -d ~/GitHub ]; then
mkdir ~/GitHub
if [ $? == 0 ]; then
printf "\n${GREEN}❯ creating ~/GitHub directory${NORMAL}\n"
fi
fi
printf "\n${BLUE}❯ cloning repos${NORMAL}\n"
printf "${YELLOW}❯ it may take few minutes ...\n"
repos=('conf-files' 'oh-my-zsh')
for repo in "${repos[@]}"
do
if [ ! -d ~/GitHub/$repo ]; then
git clone git@github.com:sarbbottam/$repo.git ~/GitHub/$repo &>/dev/null
if [ $? == 0 ]; then
printf "${GREEN}❯ cloned $repo at ~/GitHub/$repo${NORMAL}\n"
fi
fi
done
printf "\n${BLUE}❯ creating symlink for oh-mys${NORMAL}\n"
ohMys=('oh-my-zsh');
for ohMy in "${ohMys[@]}"
do
if [ -d ~/GitHub/$ohMy -a ! -L ~/.$ohMy ]; then
ln -s ~/GitHub/$ohMy ~/.$ohMy
if [ $? == 0 ]; then
printf "${GREEN}❯ created symlink ~/.$ohMy to ~/GitHub/$ohMy${NORMAL}\n"
fi
fi
done
bins=('shell-customize', 'node-setup')
for bin in "${bins[@]}"
do
source ~/GitHub/conf-files/bin/$bin
done