Skip to content

Instantly share code, notes, and snippets.

@mattak
Created November 26, 2019 07:31
Show Gist options
  • Save mattak/d76059f0ea4f6cff5b68fabba2a7309d to your computer and use it in GitHub Desktop.
Save mattak/d76059f0ea4f6cff5b68fabba2a7309d to your computer and use it in GitHub Desktop.
listup unity resources which is not used
#!/bin/sh
for f in $(git ls-files | grep '.meta' | grep -v "Assets/Modules/" | egrep '(png|prefab|controller|anim|asset|playable|mp3).meta$')
do
unity_guid=$(cat "$f" | grep 'guid:' | awk '{print $2}')
matches=$(ag -l $unity_guid | wc -l | awk '{print $1}')
if [ $matches -eq 1 ]; then
echo $f | sed 's|.meta$||g'
fi
done
@mattak
Copy link
Author

mattak commented Nov 26, 2019

it requires silver searcher

brew install ag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment