merged
authorLars Hupel <lars.hupel@mytum.de>
Sat, 15 Apr 2023 23:02:01 +0200
changeset 77860 21bb32a7fd58
parent 77859 a11e25bdd247 (diff)
parent 77858 30389d96d0d6 (current diff)
child 77862 cba7246c2c32
merged
--- a/src/Tools/Code/code_target.ML	Sat Apr 15 15:19:58 2023 +0200
+++ b/src/Tools/Code/code_target.ML	Sat Apr 15 23:02:01 2023 +0200
@@ -311,9 +311,14 @@
   (case pretty_modules of
     Singleton (_, p) => Bytes.write root (format p)
   | Hierarchy code_modules =>
-      (Isabelle_System.make_directory root;
-        List.app (fn (names, p) =>
-          Bytes.write (Path.appends (root :: map Path.basic names)) (format p)) code_modules));
+     List.app (fn (names, p) =>
+       let
+         val segments = map Path.basic names;
+       in
+         Isabelle_System.make_directory (Path.appends (root :: (fst (split_last segments))));
+         Bytes.write (Path.appends (root :: segments)) (format p)
+       end)
+     code_modules);
 
 in