Skip to content

Commit 9818498

Browse files
authored
Update rm-images.sh
1 parent d2bcdb6 commit 9818498

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

rm-images.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
[[ -n ${DEBUG} ]] && set -eox
1212

1313
if ! [ -z $1 ]; then
14-
cd $1
15-
echo "Looking for unused images in $1"
14+
if [[ -d $1 ]]
15+
then
16+
cd $1
17+
fi
1618
fi
1719

20+
echo "Looking for unused images in $(pwd)"
21+
1822
imagepaths=$(find . -name '*.jpg' -o -name '*.jpeg' -o -name '*.png')
1923
counter=0
2024

@@ -29,5 +33,5 @@ done
2933
if [ "$counter" -eq "0" ]; then
3034
echo "No images were removed!"
3135
else
32-
echo "Removed a total $counter images, w00t!"
36+
echo "A total of $counter images were marked for removal, w00t!"
3337
fi

0 commit comments

Comments
 (0)