-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·81 lines (68 loc) · 2.04 KB
/
install.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
#!/bin/bash
echo ==========================================================================
echo SYMLINKING...
echo ==========================================================================
files=(
.config/mc
.config/mpv
.config/yarn
.config/zsh
.gnupg/gpg.conf
.local/share/mc/skins
.ssh/config
.vim
scripts
.asdfrc
.gitconfig
.gitignore
.iex.exs
.irbrc
.pryrc
.tool-versions
.zshenv
)
# http://misc.flogisoft.com/bash/tip_colors_and_formatting
# only `echo -e` supports these escape sequences
RED_FG="\033[31m"
LIGHT_GREEN_FG="\033[92m"
LIGHT_BLUE_FG="\033[94m"
RESET_ALL="\033[0m"
for file in "${files[@]}"; do
echo "symlinking $PWD/$file to $HOME/$file"
if [ -e "$HOME/$file" ]; then
read -p "$HOME/$file exists - remove it? [yn] " yn
if [ -z "$yn" -o ! "$yn" = 'y' ]; then
echo -e "[$LIGHT_BLUE_FG SKIP $RESET_ALL] symlinking $file skipped"
echo
continue
elif [ "$yn" = 'y' ]; then
rm -rf "$HOME/$file"
if [ $? -eq 0 ]; then
echo -e "[$LIGHT_GREEN_FG OK $RESET_ALL] $file removed"
else
echo -e "[$RED_FG FAIL $RESET_ALL] failed to remove $file"
fi
fi
fi
target_dir=`dirname "$file"`
ln -s "$PWD/$file" "$HOME/$target_dir"
if [ $? -eq 0 ]; then
echo -e "[$LIGHT_GREEN_FG OK $RESET_ALL] $file symlinked"
else
echo -e "[$RED_FG FAIL $RESET_ALL] failed to symlink $file"
fi
echo
done
echo --------------------------------------------------------------------------
echo SYMLINKING DONE
echo --------------------------------------------------------------------------
echo ==========================================================================
echo COPYING FONTS...
echo ==========================================================================
echo
echo -e "${RED_FG}copy required fonts manually!${RESET_ALL}"
echo
#cp -R Library/Fonts/ ~/Library/Fonts/
echo --------------------------------------------------------------------------
echo FONTS COPIED
echo --------------------------------------------------------------------------