make mdwn path if it doesnt exist
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 24 May 2018 08:57:11 +0000 (09:57 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 24 May 2018 08:57:11 +0000 (09:57 +0100)
src/pinmux_generator.py

index 9512d4d3bf4ce909589e87cd95fb06545d5a4fcc..c88146be844fd7b8e3207cc9fd205c27c1710dc1 100644 (file)
@@ -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)