-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·52 lines (43 loc) · 1.29 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
#!/bin/bash
lowercase(){
echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
}
OS=`lowercase \`uname\``
# echo 'name:'
# read name
# echo 'email:'
# read email
configFiles=(
"ackrc"
"bash_profile"
"bashrc"
"gemrc"
"gitconfig"
"irbrc"
"tmux.conf"
"zshrc"
)
for t in ${configFiles[@]}; do
echo "Removing .$t"
rm -rf ~/.$t
echo "symlinking $t to ~/.$t"
ln -s $PWD/$t ~/.$t
done
echo "Creating dotfile-local directory for non-repo config files"
mkdir -p "$PWD"/dotfiles-local
[ -e ~/dotfiles-local ] || ln -s "$PWD"/dotfiles-local ~/dotfiles-local
rm -rf ~/bin
ln -s "$PWD"/bin ~/bin
echo "Installing Xcode theme"
XCODE_THEME_INSTALL_PATH=~/Library/Developer/Xcode/UserData/FontAndColorThemes
XCODE_THEME_NAME=base16-twilight.dark.xccolortheme
[ -e $XCODE_THEME_INSTALL_PATH ] || mkdir -p $XCODE_THEME_INSTALL_PATH
[ -e "$XCODE_THEME_INSTALL_PATH"/"$XCODE_THEME_NAME" ] || ln -s "$PWD"/macOS/"$XCODE_THEME_NAME" "$XCODE_THEME_INSTALL_PATH"/"$XCODE_THEME_NAME"
echo "Updating Homebrew"
brew bundle install
echo "Updating git config.loca with user and email"
printf "%s[user]%s\n name = %s$name%s\n email = $email" >> ~/dotfiles-local/gitconfig.local
if [ "{$OS}"=="darwin" ]
then
printf "%s\n[credential]%s\n helper = osxkeychain" >> ~/dotfiles-local/gitconfig.local
fi