electron/build/generate-template.py
Samuel Attard 7201845894
refactor: auto generate electron_version.h from the version file (#18866)
* refactor: auto generate electron_version.h from the version file

* Update BUILD.gn

Co-Authored-By: Jeremy Apthorp <nornagon@nornagon.net>
2019-06-19 14:31:55 -07:00

16 lines
370 B
Python

import json
import sys
from string import Template
inpath = sys.argv[1]
outpath = sys.argv[2]
argpaths = sys.argv[3:]
with open(inpath, 'r') as infile, open(outpath, 'w') as outfile:
data = {}
for argpath in argpaths:
with open(argpath, 'r') as argfile:
data.update(json.load(argfile))
s = Template(infile.read()).substitute(data)
outfile.write(s)