From 284d0988e073d0c026f4b49d1caffcfc076d08c6 Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Sun, 12 Jan 2020 23:52:35 -0500 Subject: [PATCH] Added directory compatibility Remove self-explanatory message to abort script and added compatibility with directories --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index bd2785e..b3e9235 100755 --- a/install.sh +++ b/install.sh @@ -18,16 +18,16 @@ for FILE in $DOTFILES ; do if [ -L ~/$BASEFILE ]; then # If basefile is not a file, and therefore is a broken symlink if [ ! -f ~/$BASEFILE ]; then - read -p "Press [ENTER] to replace broken symlink ~/$BASEFILE. CTRL+C aborts" + read -p "Press [ENTER] to replace broken symlink ~/$BASEFILE." rm ~/$BASEFILE NEWLINK=1 else echo "~/$BASEFILE is already linked." fi - # If basefile is a regular file - elif [ -f ~/$BASEFILE ]; then + # If basefile is a regular file or directory + elif [ -f ~/$BASEFILE ] || [ -d ~/$BASEFILE ]; then DATE=$(date '+%Y%m%d%H%M%S') - read -p "Press [ENTER] to move ~/$BASEFILE to ~/$BASEFILE-$DATE. CTRL+C aborts" + read -p "Press [ENTER] to move ~/$BASEFILE to ~/$BASEFILE-$DATE." mv ~/$BASEFILE ~/$BASEFILE-$DATE NEWLINK=1 else