drop generate.sh, generate.py can do it alone using recursive glob

This commit is contained in:
Wolfgang Hottgenroth 2021-08-29 12:44:38 +02:00
parent 95fbafb217
commit 2733c5fbac
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
2 changed files with 3 additions and 8 deletions

View File

@ -10,9 +10,9 @@ parser.add_argument('--schema', '-s',
default='./schema.json')
parser.add_argument('--template', '-t',
help="""Template file, templates files must be named as the final output file
with an additional .tmpl extension. Default: all template files in the current folder.""",
with an additional .tmpl extension. Default: all template files recursively from the current folder.""",
required=False,
default="*.tmpl")
default="**/*.tmpl")
args = parser.parse_args()
@ -51,7 +51,7 @@ schema["GENERATED_PYTHON_COMMENT"] = """
# DO NOT EDIT MANUALLY
"""
for f in glob.glob(args.template):
for f in glob.glob(args.template, recursive=True):
print(f"process {f}")
tmpl = Template(file=f, searchList=[schema])
with open(f[:-5], 'w') as outFile:

View File

@ -1,5 +0,0 @@
#!/bin/bash
find . -name \*.tmpl -exec python generate.py --schema schema.json --template {} \;