drop generate.sh, generate.py can do it alone using recursive glob
This commit is contained in:
parent
95fbafb217
commit
2733c5fbac
@ -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:
|
||||
|
@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
find . -name \*.tmpl -exec python generate.py --schema schema.json --template {} \;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user