-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·66 lines (48 loc) · 1.18 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
#!/usr/bin/env bash
DOTFILES_ROOT="`pwd`"
################################################################################
# Output helpers
info () {
printf " [ \033[00;34m..\033[0m ] $1"
}
success () {
printf "\r\033[2K [ \033[00;32mOK\033[0m ] $1\n"
}
fail () {
printf "\r\033[2K [\033[0;31mFAIL\033[0m] $1\n"
echo ''
exit
}
################################################################################
# Install helpers
backup_file () {
mv "$1" "${1}.backup"
success "moved $1 to ${1}.backup"
}
link_files () {
if [ ! -h "$2" ]
then
ln -s "$1" "$2"
fi
success "linked $1 to $2"
}
install_dotfiles () {
for source in `find $DOTFILES_ROOT -maxdepth 2 -name \*.symlink`
do
dest="$HOME/.`basename \"${source%.*}\"`"
if [ -f $dest ] || [ -d $dest ]
then
backup_file $dest
fi
link_files $source $dest
done
}
install_font () {
font_dir=~/Library/Fonts
# Again, just overwrite
cp "$DOTFILES_ROOT/system/fonts/Menlo+Regular+for+Powerline.ttf" "$font_dir"
success "Copied Menlo Powerline font to $font_dir"
}
################################################################################
install_dotfiles
install_font