From 302b814c4144d9bf2ef0ef7f29134bfa97c5cbd1 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 24 May 2018 09:57:11 +0100 Subject: [PATCH] make mdwn path if it doesnt exist --- src/pinmux_generator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pinmux_generator.py b/src/pinmux_generator.py index 9512d4d..c88146b 100644 --- a/src/pinmux_generator.py +++ b/src/pinmux_generator.py @@ -77,7 +77,11 @@ if __name__ == '__main__': printhelp() sys.exit(1) module = modules[pinspec] + fname = os.path.join(output_dir or '', "%s.mdwn" % pinspec) + d = os.path.split(fname)[0] + if not os.path.exists(d): + os.makedirs(d) with open(fname, "w") as of: pinout, bankspec, pinspec, fixedpins = module.pinspec(of) specgen(of, output_dir, pinout, bankspec, pinspec, fixedpins) -- 2.30.2