1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

tools/setup: don't overwrite existing args.gn

This commit is contained in:
Bert Belder 2018-08-28 02:01:12 +02:00
parent f47582bbc5
commit fe9ca53bc2
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461

View file

@ -63,8 +63,6 @@ def get_gn_args():
def gn_gen(mode):
os.environ["DENO_BUILD_MODE"] = mode
gn_args = get_gn_args()
# mkdir $build_path(). We do this so we can write args.gn before running gn gen.
if not os.path.isdir(build_path()):
os.makedirs(build_path())
@ -73,7 +71,10 @@ def gn_gen(mode):
# This is to avoid quoting/escaping complications when passing overrides as
# command-line arguments.
args_filename = os.path.join(build_path(), "args.gn")
if not os.path.exists(args_filename) or gn_args:
if os.path.exists(args_filename):
print "Skip writing args file: '%s' already exists." % args_filename
else:
gn_args = get_gn_args()
with open(args_filename, "w+") as f:
f.write("\n".join(gn_args) + "\n")