diff options
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-x | bootstrap.sh | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/bootstrap.sh b/bootstrap.sh index b4b8f96..e7b0f07 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,18 +1,22 @@ #!/usr/bin/env bash -cd "$(dirname "${BASH_SOURCE}")" -git pull origin master + +cd "$(dirname "${BASH_SOURCE}")"; + +git pull origin master; + function doIt() { rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" \ - --exclude "README.md" --exclude "LICENSE-MIT.txt" -avh --no-perms . ~ - source ~/.bash_profile + --exclude "README.md" --exclude "LICENSE-MIT.txt" -avh --no-perms . ~; + source ~/.bash_profile; } + if [ "$1" == "--force" -o "$1" == "-f" ]; then - doIt + doIt; else - read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1 - echo + read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1; + echo ""; if [[ $REPLY =~ ^[Yy]$ ]]; then - doIt - fi -fi -unset doIt + doIt; + fi; +fi; +unset doIt; |