summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Translate.ml6
-rw-r--r--src/dune3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/Translate.ml b/src/Translate.ml
index 1a42892d..5812dc89 100644
--- a/src/Translate.ml
+++ b/src/Translate.ml
@@ -639,6 +639,12 @@ let translate_module (filename : string) (dest_dir : string) (config : config)
}
in
+ (* Create the directory, if necessary *)
+ if not (Sys.file_exists dest_dir) then (
+ log#linfo (lazy ("Creating missing directory: " ^ dest_dir));
+ (* Create a directory with *default* permissions *)
+ Core.Unix.mkdir_p dest_dir);
+
(* Extract one or several files, depending on the configuration *)
if config.split_files then (
let base_gen_config =
diff --git a/src/dune b/src/dune
index 151b2f70..70de366c 100644
--- a/src/dune
+++ b/src/dune
@@ -1,7 +1,8 @@
+;; core: for Core.Unix.mkdir_p
(executable
(name main)
(preprocess (pps ppx_deriving.show ppx_deriving.ord visitors.ppx))
- (libraries ppx_deriving yojson zarith easy_logging))
+ (libraries ppx_deriving yojson zarith easy_logging core))
(env
(dev (flags