mirror of
https://github.com/Matir/skel.git
synced 2026-05-26 13:35:42 -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:-.}
|
DIR=${1:-.}
|
||||||
FINDCMD=(find ${DIR} -type l -xtype l)
|
FINDCMD=(find ${DIR} -type l -xtype l)
|
||||||
if (($ASK)) ; then
|
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] '
|
echo -n 'Delete these links? [y/n] '
|
||||||
if read -q ; then
|
if read -q ; then
|
||||||
${FINDCMD} -delete
|
${FINDCMD} -delete
|
||||||
|
|||||||
Reference in New Issue
Block a user