diff options
Diffstat (limited to '')
-rwxr-xr-x | bootstrap.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bootstrap.sh b/bootstrap.sh index 516c407..df2d339 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,10 +1,10 @@ #!/usr/bin/env sh -SYMLINKDIR=$(readlink -f "$0") -BASEDIR=$(dirname "$SYMLINKDIR") +SYMLINKDIR="$(readlink -f "$0")" +BASEDIR="$(dirname "$SYMLINKDIR")" cd $BASEDIR -function doIt() { +doIt() { git submodule update --init --recursive rsync --exclude ".git/" \ --exclude ".DS_Store" \ @@ -19,13 +19,15 @@ function doIt() { -avh --no-perms ./ ~/ } -if [ "$1" == "--force" -o "$1" == "-f" ]; then +if [ "$1" = "--force" -o "$1" = "-f" ]; then doIt; else - read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1; + printf "This may overwrite existing files in your home directory. Are you sure? (y/n) "; + read REPLY; echo ""; - if [[ $REPLY =~ ^[Yy]$ ]]; then + if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then doIt; + else exit 1; fi; fi; |