mirror of
https://github.com/wahyd4/dotfiles.git
synced 2026-08-09 04:46:12 +10:00
Allow running bootstrap.sh with a --force or -f option
This avoids the confirmation prompt.
This commit is contained in:
+12
-4
@@ -2,9 +2,17 @@
|
||||
mkdir -p ~/.vim/{backups,swaps,undo}
|
||||
cd "$(dirname "$0")"
|
||||
git pull
|
||||
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
function doIt() {
|
||||
rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" --exclude "README.md" -av . ~
|
||||
}
|
||||
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
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
doIt
|
||||
fi
|
||||
fi
|
||||
source "$HOME/.bash_profile"
|
||||
unset doIt
|
||||
source ~/.bash_profile
|
||||
Reference in New Issue
Block a user