File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,15 @@ let refresh_state ctx =
74
74
match ctx.state_filepath with
75
75
| None -> Ok ctx
76
76
| Some path ->
77
- log#info " loading saved state from file %s" path;
78
- ( match get_local_file path with
79
- | Error e -> fmt_error " error while getting local file: %s\n failed to get state from file %s" e path
80
- | Ok file ->
81
- let state = State_j. state_of_string file in
82
- Ok { ctx with state }
83
- )
77
+ if Caml.Sys. file_exists path then begin
78
+ log#info " loading saved state from file %s" path;
79
+ match get_local_file path with
80
+ | Error e -> fmt_error " error while getting local file: %s\n failed to get state from file %s" e path
81
+ | Ok file ->
82
+ let state = State_j. state_of_string file in
83
+ Ok { ctx with state }
84
+ end
85
+ else Ok ctx
84
86
85
87
let print_config ctx =
86
88
let cfg = get_config_exn ctx in
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ let secrets =
73
73
74
74
let state =
75
75
let doc = " state file" in
76
- Arg. (value & opt (some file ) None & info [ " state" ] ~docv: " STATE" ~doc )
76
+ Arg. (value & opt (some string ) None & info [ " state" ] ~docv: " STATE" ~doc )
77
77
78
78
let gh_payload =
79
79
let doc = " JSON file containing a github webhook payload" in
You can’t perform that action at this time.
0 commit comments