From 270f56cdd6b9c7592d60fd6957ba2db1ae98016f Mon Sep 17 00:00:00 2001 From: swrup Date: Thu, 20 Nov 2025 21:39:12 +0100 Subject: [PATCH] crunch config --- default.config => src/assets/default.config | 0 src/config.ml | 12 +++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) rename default.config => src/assets/default.config (100%) diff --git a/default.config b/src/assets/default.config similarity index 100% rename from default.config rename to src/assets/default.config diff --git a/src/config.ml b/src/config.ml index 725963b2..197d586f 100644 --- a/src/config.ml +++ b/src/config.ml @@ -1,11 +1,13 @@ open Parse_config let config_data = - let read_file file = In_channel.with_open_bin file In_channel.input_all in - let content = read_file "default.config" in - let v = Parse_data.parse content in - (*Fmt.epr "config file:@\n%a@." Pp_debug.pp_config v;*) - v + let path = Fpath.to_string (Fpath.v "default.config") in + match Assets_crunch.read path with + | None -> Fmt.failwith "static file not found: `%s`" path + | Some data -> + let v = Parse_data.parse data in + (*Fmt.epr "config file:@\n%a@." Pp_debug.pp_config v;*) + v module Exchange = struct let get_opt field = get_opt config_data ~section:"exchange" ~field