-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap
executable file
·97 lines (83 loc) · 2.29 KB
/
bootstrap
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
#!/bin/bash
set -e
if [ "$1" == "--debug" ]; then
set -x
fi
DIR="$(cd "$(dirname "$0")/../" && pwd)"
# Use .bash_profile from dotfiles
install_bash_profile() {
BASH_PROFILE="$HOME/.bash_profile"
echo "👨🏻💻 Installing .bash_profile..."
ln -sf "$DIR"/.bash_profile "$BASH_PROFILE"
}
# Set default shell to bash
configure_shell() {
echo "🐚 Configuring shell..."
BASH_PATH="/usr/local/bin/bash"
if [ "$SHELL" != "$BASH_PATH" ] ; then
FILE="/etc/shells"
BASH_CONFIGURED=$(grep "$BASH_PATH" "$FILE" || true)
if [ -z "$BASH_CONFIGURED" ] ; then
echo "$BASH_PATH" | sudo tee -a $FILE > /dev/null
fi
chsh -s "$BASH_PATH"
fi
}
# Use .gitignore_global from dotfiles
install_gitignore() {
echo "⚙️ Configuring git..."
ln -sf "$DIR/.gitignore_global" "$HOME/.gitignore_global"
git config --global core.excludesfile "$HOME/.gitignore_global"
git config --global push.default current
}
# Use .gitignore_global from dotfiles
install_bash_it() {
echo "🎨 Installing bash-it"
BASH_IT="$HOME/.bash-it"
if [ ! -d "$BASH_IT" ] ; then
git clone --quiet --depth=1 https://github.com/Bash-it/bash-it.git "$BASH_IT"
fi
}
install_powerline_fonts() {
echo "🔠 Installing powerline-fonts..."
POWERLINE_FONTS="$HOME/.powerline-fonts"
if [ ! -d "$POWERLINE_FONTS" ] ; then
git clone https://github.com/powerline/fonts.git --quiet --depth=1 "$POWERLINE_FONTS"
fi
bash "$POWERLINE_FONTS/install.sh" >> /dev/null
}
configure_atom() {
echo "⚛️ Configuring atom..."
mkdir -p "$HOME/.atom"
ln -sf "$DIR/config/atom/config.cson" "$HOME/.atom/."
}
configure_iterm2() {
if [ "$(uname)" == "Darwin" ] ; then
echo "👾 Configuring iTerm2..."
defaults import com.googlecode.iTerm2 "$DIR"/config/iterm2/com.googlecode.iterm2.plist
fi
}
configure_macOS() {
if [ "$(uname)" == "Darwin" ] ; then
echo "🍏 Configuring macOS..."
for PLIST in "$DIR"/config/macOS/*.plist
do
SETTING=$(basename "$PLIST" .plist)
defaults import "$SETTING" "$PLIST"
done
killall Dock
fi
}
partytime() {
echo -e "\n🤙 Looks like we're good to go! Open a new shell!"
}
# Do the things...
configure_shell
configure_atom
configure_iterm2
configure_macOS
install_bash_profile
install_gitignore
install_bash_it
install_powerline_fonts
partytime