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>
This commit is contained in:
Samuel Attard 2019-06-19 14:31:55 -07:00 committed by GitHub
parent 504edf2cf6
commit 7201845894
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 143 additions and 62 deletions

View file

@ -0,0 +1,16 @@
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)