Skip to content

Instantly share code, notes, and snippets.

@rufus2021
Created June 17, 2016 19:06
Show Gist options
  • Save rufus2021/5a4c4eb1e7423a27685bd6537f15d8dd to your computer and use it in GitHub Desktop.
Save rufus2021/5a4c4eb1e7423a27685bd6537f15d8dd to your computer and use it in GitHub Desktop.
#! /bin/bash
DIR="lib/client/images"
for filename in $DIR/*; do
FILE=${filename##*/};
FOUND=`egrep -lr --include=*.{scss,jsx,js} "($FILE)" ./lib`
if [ "$FOUND" ]
then
echo ""
else
echo "$FILE is not found. Removing!"
rm "${DIR}/${FILE}"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment