Created
March 15, 2016 08:56
-
-
Save linmic/3c8dce3d5c01398de30e 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