Created
August 25, 2016 06:44
-
-
Save linmic/22b855c76fb7c58b4a66772fd56ff13b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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