mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
Don't ask for confirmation if there are no results.
This commit is contained in:
@@ -14,7 +14,12 @@ prune-broken-symlinks() {
|
||||
DIR=${1:-.}
|
||||
FINDCMD=(find ${DIR} -type l -xtype l)
|
||||
if (($ASK)) ; then
|
||||
${FINDCMD} -print
|
||||
local FILES
|
||||
FILES=`${FINDCMD} -print`
|
||||
if [[ "${FILES}" == "" ]] ; then
|
||||
return 0
|
||||
fi
|
||||
echo ${FILES}
|
||||
echo -n 'Delete these links? [y/n] '
|
||||
if read -q ; then
|
||||
${FINDCMD} -delete
|
||||
|
||||
Reference in New Issue
Block a user