-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.sh
More file actions
executable file
·48 lines (39 loc) · 1.13 KB
/
sync.sh
File metadata and controls
executable file
·48 lines (39 loc) · 1.13 KB
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
BIN=$HOME/bin
WORKSPACE=$HOME/workspace
DOTFILES=$PWD/`dirname $0 | sed 's|^\./||'`
function make_environment_dirs {
mkdir -p $BIN
mkdir -p $HOME/.bashrc.d
mkdir -p $HOME/.vim
}
function sync_config_files {
#Backup current $HOME/.bashrc if it exists
test -h $HOME/.bashrc || mv $HOME/.bashrc $HOME/.bashrc.d/
#Symlink all config files from this repo into their proper location
local ignore_files='README.md|sync.sh|.swp|.git/'
local sync_files=`find $DOTFILES -type f | egrep -v "($ignore_files)" | sed "s|^$DOTFILES/||"`
for i in $sync_files; do
ln -s $DOTFILES/$i $HOME/$i
done
}
function setup_rsa {
test -e $HOME/.ssh/id_rsa.pub || ssh-keygen -qf $HOME/.ssh/id_rsa -N ''
}
function setup_vim {
git clone https://github.com/gmarik/vundle.git $HOME/.vim/bundle/vundle
mkdir -p $HOME/.vim/undodir
vim -c BundleInstall -c cq
}
function sync_environment {
make_environment_dirs
sync_config_files
setup_rsa
# setup_vim
}
function main {
sync_environment # &> /dev/null
source $HOME/.bashrc
}
main
echo Remember to give $HOME/.ssh/id_rsa.pub to github
echo Also check that ~/.vimrc.d was linked...likely bug