Skip to content

Instantly share code, notes, and snippets.

@linmic
Created August 25, 2016 06:44
Show Gist options
  • Save linmic/22b855c76fb7c58b4a66772fd56ff13b to your computer and use it in GitHub Desktop.
Save linmic/22b855c76fb7c58b4a66772fd56ff13b to your computer and use it in GitHub Desktop.
#!/usr/bin/python2.7
PATH='./src/assets/'
import os, subprocess
for f in os.listdir(PATH):
name, ext = os.path.splitext(f)
if ext in ['.svg', '.png', '.jpg', '.ico']:
output = subprocess.Popen(['ag', '%s' % f], stdout=subprocess.PIPE).communicate()[0];
if not len(output):
print '%s is unused and should be removed.' % (PATH + f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment