-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
bootstrap.sh
151 lines (125 loc) Β· 3.65 KB
/
bootstrap.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
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
#!/usr/bin/env bash
BLACK='\033[0;30m'
RED='\033[0;31m'
GREEN='\033[0;32m'
BRORANGE='\033[0;33m' # brown/orange
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
LGRAY='\033[0;37m' # light gray
DGRAY='\033[1;30m' # dark gray
LRED='\033[1;31m' # light red
LGREEN='\033[1;32m' # light green
YELLOW='\033[1;33m'
LBLUE='\033[1;34m' # light blue
LPURPLE='\033[1;35m' # light purple
LCYAN='\033[1;36m' # light cyan
WHITE='\033[1;37m'
NC='\033[0m' # No Color
# Dotfiles directory
DOTFILES="$HOME/.dotfiles"
# Intro message
echo "${CYAN}
******** ** ** ******
/**///// /** /** **////**
/** /** /** ** //
/******* //** ** /**
/**//// //** ** /**
/** //**** //** **
/** //** //******
// // //////
${LGREEN}
+-+-+-+-+-+-+-+-+
|D|o|t|f|i|l|e|s|
+-+-+-+-+-+-+-+-+
${WHITE}
https://github.com/FrancesCoronel/dotfiles.git
${NC}
"
# downloading Apple Dev Tools
echo "${LGREEN}To run this, you must download & install the latest Xcode and Command Line Tools${NC}"
echo " > https://developer.apple.com/xcode/"
echo " > https://developer.apple.com/downloads/"
xcode-select --install
# function to check if a package exists
check () { type -t "${@}" > /dev/null 2>&1; }
# function to install Homebrew Formulas
install_formula () {
echo ""
echo "${LGREEN}Installing Homebrew Packages...${NC}"
brew install asciinema
brew install duti
brew install gh
brew install git
brew install git-lfs
brew install howdoi
brew install hugo
brew install libav
brew install nginx
brew install node
brew install openssl
brew install pandoc
brew install python
brew install yarn
brew install youtube-dl
brew install zsh
# cleanup
echo ""
echo "${LGREEN}Cleaning up Homebrew installation...${NC}"
brew cleanup
yes | cp -rf ${DOTFILES}/bin/shell/.bashrc $HOME/.bashrc
yes | cp -rf ${DOTFILES}/bin/shell/.bash_aliases $HOME/.bash_aliases
yes | cp -rf ${DOTFILES}/bin/shell/.bash_profile $HOME/.bash_profile
echo "${LGREEN}Installing Caskroom, Caskroom versions, Caskroom Fonts and Brew Services${NC}"
# restart terminal to apply changes
echo "β β β β β
${LGREEN}Bootstrapping complete!
β β β β β{$NC}"
echo "Quitting terminal now...${NC}"
brew tap homebrew/cask
brew tap homebrew/services
brew tap homebrew/cask-versions
brew tap homebrew/cask-fonts
# Make /Applications the default location of installed Homebrew casks
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
killall Terminal
}
# no problem
no_homebrew () {
echo "${CYAN}Okay no problem, you can move on to the next step now.${NC}"
}
# install Hushlogin
echo ""
echo "${LGREEN}Installing hushlogin...${NC}"
echo "Disabling the system copyright notice, the date and time of the last login."
echo "More info at https://github.com/FrancesCoronel/dotfiles/blob/master/init/.hushlogin"
echo ""
yes | cp -rf "${DOTFILES}/init/.hushlogin" $HOME/.hushlogin
touch .hushlogin
# install Homebrew
echo ""
echo "${LGREEN}Checking if Homebrew is installed...${NC}"
if check brew; then
echo ""
echo "${YELLOW}Awesome! Homebrew is installed! Now updating...${NC}"
echo ""
brew upgrade
brew update
fi
if ! check brew; then
echo "${LGREEN}Downloading and install homebrew${NC}"
echo ""
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# run Brew doctor before anything else
brew doctor
fi
# install Homebrew Formulas
while true; do
read -p "Would you like to install Homebrew formulas? [y/n]" answer
echo "${NC}"
case $answer in
[y/Y]* ) install_formula; break;;
[n/N]* ) no_homebrew; break;;
* ) echo "${RED}Please answer Y or N.${NC}";;
esac
done