add filter to cleanyaml. run cleanyaml

bradl/rescrape-monsters
Brad Laney 2020-09-15 13:50:16 -05:00
parent 8457dc1384
commit c9476edf04
2 changed files with 1314 additions and 1317 deletions

View File

@ -4,6 +4,7 @@
import yaml import yaml
import glob import glob
import os import os
import sys
@ -14,8 +15,15 @@ def main():
# gets all files with a yaml extension in the directory # gets all files with a yaml extension in the directory
yfiles = [] yfiles = []
filter = ""
if len(sys.argv) > 1:
filter = sys.argv[1]
for file in glob.glob("**/*.yaml", recursive=True): for file in glob.glob("**/*.yaml", recursive=True):
if filter == "":
yfiles.append(file) yfiles.append(file)
elif file.find(filter) > -1:
yfiles.append(file)
yfiles.sort() yfiles.sort()
print("Going to clean up the following files: {}".format(yfiles)) print("Going to clean up the following files: {}".format(yfiles))

File diff suppressed because it is too large Load Diff