File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -672,14 +672,22 @@ let get_config_option_server ?local ?(save_back=false) ?(allow_static=false) ser
672
672
Lwt. return_unit
673
673
)
674
674
> |= fun () -> (Some c, server_version)
675
- | None -> Lwt. return (None , None )
675
+ | None ->
676
+ match server_opt with
677
+ | Some server ->
678
+ let c = ConfigFile. {server; token = None } in
679
+ check_server_version ~allow_static server
680
+ >> = fun server_version ->
681
+ (* Note: could raise an error if save_back=true *)
682
+ Lwt. return (Some c, server_version)
683
+ | None -> Lwt. return (None , None )
676
684
677
685
let get_config_server ?local ?(save_back =false ) ?(allow_static =false ) server_opt =
678
686
get_config_option_server ?local ~save_back ~allow_static server_opt
679
687
>> = function
680
688
| Some c , o -> Lwt. return (c, o)
681
689
(* TODO: Make it possible to change this error message (from get_config_o_server) *)
682
- | None , _ -> Lwt. fail_with " No config file found. Please do `learn-ocaml-client init`"
690
+ | None , _ -> Lwt. fail_with " No config file found. Please do `learn-ocaml-client init`, or pass a --server= \" URL \" option "
683
691
684
692
let get_config_o_server ?save_back ?(allow_static =false ) o =
685
693
let open Args_server in
You can’t perform that action at this time.
0 commit comments