Skip to content

Commit

Permalink
Update rm-images.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemar authored May 7, 2020
1 parent d2bcdb6 commit 9818498
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rm-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
[[ -n ${DEBUG} ]] && set -eox

if ! [ -z $1 ]; then
cd $1
echo "Looking for unused images in $1"
if [[ -d $1 ]]
then
cd $1
fi
fi

echo "Looking for unused images in $(pwd)"

imagepaths=$(find . -name '*.jpg' -o -name '*.jpeg' -o -name '*.png')
counter=0

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

0 comments on commit 9818498

Please sign in to comment.