From 57212b57011e98066684271bbd792bf51bd00e4d Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Mon, 8 Feb 2021 15:00:44 +0000 Subject: [PATCH] set_config.py now defines $target. --- scripts/set_config.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/set_config.py b/scripts/set_config.py index 8c4fe08..69d6cab 100755 --- a/scripts/set_config.py +++ b/scripts/set_config.py @@ -69,17 +69,18 @@ def set_config(target, usage = None): sys.exit(1) fname = source_dir + "/target.scad" - text = "include \n" % target; - line = "" + text = ['include \n' % target, '$target = "%s";\n' % target]; + lines = [""] try: with open(fname,"rt") as f: - line = f.read() + line = f.readlines() except: pass - if line != text: + if lines != text: with open(fname,"wt") as f: - f. write(text); + for t in text: + f. write(t); return target + "/" def usage():