Created
February 8, 2020 14:09
-
-
Save SeijiEmery/015d70c4f5a3ff3a760c931f13ffecb1 to your computer and use it in GitHub Desktop.
Utility script: prints out non-file-associated meta files in a given unity directory, with the git command to remove them
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
import os | |
import sys | |
if __name__ == '__main__': | |
if len(sys.argv) > 1: | |
os.chdir(sys.argv[1]) | |
target_dir = './Assets' | |
dir_meta_files = set([ | |
os.path.join(path, file) | |
for path, dirs, files in os.walk(target_dir) | |
for file in files | |
if file.endswith('.meta') and len(file.split('.')) == 2 | |
]) | |
print("git rm %s" % ' '.join([ | |
'"%s"' % file for file in dir_meta_files | |
])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
useful if you forgot to add this: https://answers.unity.com/questions/547795/ignoring-folder-meta-files-on-version-control.html, and have a bunch of directory-associated meta files that you want to remove