diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-10-05 16:24:27 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-10-05 16:24:27 +0200 |
commit | 0c621f842c3905b3f7b769fd6ee23efc188d16a4 (patch) | |
tree | 630c38c7bed099f63ccb814b5c2e9238184d217b /py | |
parent | e7594ab06f9402c75f30a0cd55565672ffb2635c (diff) | |
download | kicad-utils-0c621f842c3905b3f7b769fd6ee23efc188d16a4.tar.gz kicad-utils-0c621f842c3905b3f7b769fd6ee23efc188d16a4.tar.bz2 kicad-utils-0c621f842c3905b3f7b769fd6ee23efc188d16a4.tar.xz kicad-utils-0c621f842c3905b3f7b769fd6ee23efc188d16a4.zip |
o Make directory before creating files.
Diffstat (limited to 'py')
-rwxr-xr-x | py/kicad_gerber.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/py/kicad_gerber.py b/py/kicad_gerber.py index c6f6e4b..f57be9a 100755 --- a/py/kicad_gerber.py +++ b/py/kicad_gerber.py @@ -103,7 +103,16 @@ for layerNum in layers.CuStack(): pctl = PLOT_CONTROLLER(board) popt = pctl.GetPlotOptions() -popt.SetOutputDirectory(args.output_directory) + +output_directory = args.output_directory +popt.SetOutputDirectory(output_directory) + +if not os.path.isdir(output_directory): + try: + os.makedirs(output_directory) + except: + print("Could not make output directory", file=sys.stderr) + sys.exit(1) # A nasty hack to get the base filename pctl.SetLayer(F_Cu) |