chiark / gitweb /
documentation/doxygen: don't create output dir if it's empty.
authorVladimír Vondruš <mosra@centrum.cz>
Sat, 7 Nov 2020 15:29:02 +0000 (16:29 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 7 Nov 2020 15:29:02 +0000 (16:29 +0100)
It doesn't make sense to me why makedirs() wouldn't just gracefully
no-op that.

documentation/doxygen.py

index fb0ce03e74a941c22d8b08e6a75c01e5db882ee9..4ca2e45b21724073a1665507bb980cc647a1ac99 100755 (executable)
@@ -3843,8 +3843,10 @@ if __name__ == '__main__': # pragma: no cover
     parse_doxyfile(state, doxyfile)
 
     # Doxygen is stupid and can't create nested directories, create the input
-    # directory for it
-    os.makedirs(state.doxyfile['OUTPUT_DIRECTORY'], exist_ok=True)
+    # directory for it. Don't do it when the argument is empty, because
+    # apparently makedirs() is also stupid.
+    if state.doxyfile['OUTPUT_DIRECTORY']:
+        os.makedirs(state.doxyfile['OUTPUT_DIRECTORY'], exist_ok=True)
 
     if not args.no_doxygen:
         logging.debug("running Doxygen on {}".format(doxyfile))