diff options
Diffstat (limited to 'lib/configuration')
| -rw-r--r-- | lib/configuration/importConf.ml | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/lib/configuration/importConf.ml b/lib/configuration/importConf.ml index eb7c8d2..3406a11 100644 --- a/lib/configuration/importConf.ml +++ b/lib/configuration/importConf.ml @@ -31,11 +31,15 @@ module TomlReader = Read_conf.Make (Helpers.Toml.Decode)  let t_of_toml : Otoml.t -> (Syntax.t, string) result =   fun toml -> +  let latest_version = 1 in +    let version = -    Otoml.find toml (Otoml.get_integer ~strict:false) [ "version" ] +    Otoml.find_or ~default:latest_version toml +      (Otoml.get_integer ~strict:false) +      [ "version" ]    in    match version with -  | 1 -> TomlReader.read toml +  | n when n = latest_version -> TomlReader.read toml    | _ ->        Printf.eprintf "Unsuported version : %d\n" version;        exit 1 | 
