Skip to content

Commit 1ad2541

Browse files
author
Jon Ludlam
authored
Merge pull request #46 from robhoes/master
CA-222845: Create dir for state_path proactively
2 parents b265934 + 3c6230f commit 1ad2541

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main.ml

+2
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ module Attached_SRs = struct
173173
return ()
174174
| Some path ->
175175
let contents = String.Table.sexp_of_t sexp_of_state !sr_table |> Sexplib.Sexp.to_string in
176+
let dir = Filename.dirname path in
177+
Unix.mkdir ~p:() dir >>= fun () ->
176178
Writer.save path ~contents
177179
) >>= fun () ->
178180
return (Ok ())

0 commit comments

Comments
 (0)