bottom/deployment/windows/winget/product_code.py
Clement Tsang 8aa1303b3c
ci: update winget template + deploy for more info (#554)
Adds a `ProductCode`, `Scope`, and `Commands` field to the template, as well as additional changes to the deploy process to determine + fill in the `ProductCode` automatically.
2021-07-21 22:02:00 -04:00

21 lines
620 B
Python

import sys
from string import Template
args = sys.argv
template_file_path = args[1]
product_code = args[2]
with open(template_file_path, "r") as template_file:
template = Template(template_file.read())
substitutes = dict()
substitutes["product_code"] = "'{}'".format(product_code)
substitute = template.safe_substitute(substitutes)
print("\n================== Generated package file ==================\n")
print(substitute)
print("\n============================================================\n")
with open(template_file_path, "w") as template_file:
template_file.write(substitute)