Added directory compatibility
Remove self-explanatory message to abort script and added compatibility with directories
This commit is contained in:
parent
26a0ec9cd7
commit
284d0988e0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user