set_config.py now defines $target.
This commit is contained in:
parent
1c3f136657
commit
57212b5701
|
@ -69,17 +69,18 @@ def set_config(target, usage = None):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
fname = source_dir + "/target.scad"
|
fname = source_dir + "/target.scad"
|
||||||
text = "include <config_%s.scad>\n" % target;
|
text = ['include <config_%s.scad>\n' % target, '$target = "%s";\n' % target];
|
||||||
line = ""
|
lines = [""]
|
||||||
try:
|
try:
|
||||||
with open(fname,"rt") as f:
|
with open(fname,"rt") as f:
|
||||||
line = f.read()
|
line = f.readlines()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if line != text:
|
if lines != text:
|
||||||
with open(fname,"wt") as f:
|
with open(fname,"wt") as f:
|
||||||
f. write(text);
|
for t in text:
|
||||||
|
f. write(t);
|
||||||
return target + "/"
|
return target + "/"
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
|
|
Loading…
Reference in New Issue