in tooling/generate-templates/generate-templates.py [0:0]
def readTemplates(template_path):
arm = {}
bicep = {}
# Read ARM templates from arm directory into a string
for root, dirs, files in os.walk(os.path.join(template_path, 'arm')):
for file in files:
if file.endswith('.json'):
# read the file into a string
with open(os.path.join(root, file)) as f:
arm[file.replace('.json','')] = f.read()
# Read Bicep templates from arm directory into a string
for root, dirs, files in os.walk(os.path.join(template_path, 'bicep')):
for file in files:
if file.endswith('.bicep'):
# read the file into a string
with open(os.path.join(root, file)) as f:
bicep[file.replace('.bicep','')] = f.read()
return arm, bicep