forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.sh
More file actions
31 lines (27 loc) · 647 Bytes
/
sync.sh
File metadata and controls
31 lines (27 loc) · 647 Bytes
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
#!/bin/bash
cd "$(dirname "${BASH_SOURCE}")";
git pull origin master;
function doUpdate() {
rsync --exclude ".git/" \
--exclude "init" \
--exclude ".DS_Store" \
--exclude ".macos" \
--exclude ".vimrc_remote" \
--exclude "bootstrap.sh" \
--exclude "sync.sh" \
--exclude "brew.sh" \
--exclude "README.md" \
--exclude "LICENSE-MIT.txt" \
-avh --no-perms . ~;
source ~/.bash_profile;
}
if [ "$1" == "--force" -o "$1" == "-f" ]; then
doUpdate;
else
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
doUpdate;
fi;
fi;
unset doUpdate;