-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrestore.sh
45 lines (35 loc) · 1.26 KB
/
restore.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
#!/bin/bash
# Restoration of dot files
# Vim restoration
cp -R vim/ ~/.vim
cp vimrc ~/.vimrc
# Create vim directories for backup/tmp if they don't exist
if [ -d ~/.vim/backup/ ]; then
mkdir -p ~/.vim/backup
fi
if [ -d ~/.vim/tmp/ ]; then
mkdir -p ~/.vim/tmp
fi
# Git restoration
cp gitignore_global ~/.gitignore_global
git config --global user.name "Ryan Warner"
git config --global core.excludesfile ~/.gitignore_global
# Bash restoration
cp bash/bash_aliases ~/.bash_aliases
cp bash/bash_profile ~/.bash_profile
if [ "$(uname)" == "Darwin" ]; then
# OS X specific
# Seperating the iTerm2 loading since Linux wouldn't utilize this
# iTerm2 -> Preferences -> General has an auto-save to directory
# Specify the preferences directory
defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "$PWD/iTerm2"
# Tell iTerm2 to use the custom preferences in the directory
defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true
#Force iTerm2 to read new settings
defaults read com.googlecode.iterm2
echo "Please restart iTerm2, if executing a restore from iTerm2"
elif [ "$(uname)" == "Linux" ]; then
#Linux specific
#elif block can't be empty
echo "No iTerm2 on Linux, ignoring"
fi