fixed paths

This commit is contained in:
cpu
2026-06-11 18:53:34 +02:00
parent 9af1c69b74
commit 481d49eaf3
2 changed files with 16 additions and 6 deletions

View File

@@ -242,7 +242,16 @@ def main():
if not p.exists():
sys.exit(f"ERROR: {label} file not found: {p}")
out = Path(args.output) if args.output else gbr.with_suffix('.pm4n')
if args.output:
out = Path(args.output)
else:
# If in 'output/gerbers/', default to 'output/pm4n/'
parent = gbr.parent
if parent.name == 'gerbers' and parent.parent.name == 'output':
out = parent.parent / 'pm4n' / gbr.with_suffix('.pm4n').name
else:
out = gbr.with_suffix('.pm4n')
pos_mm = None
if args.pos:
try: