diff options
| author | doongjohn <doongjohn@gmail.com> | 2025-10-28 16:41:51 +0900 |
|---|---|---|
| committer | doongjohn <doongjohn@gmail.com> | 2025-10-28 16:41:51 +0900 |
| commit | 6c1c90ed004058030ece022bafde11906b28fd5a (patch) | |
| tree | a945b6c113779a3a8738b888c299efef7590656c | |
| parent | ffb7b58d3841cf50103ab21148b814a3ad29afa4 (diff) | |
Fix read_ols_initialize_options not initializing collections on second
initialize request.
| -rw-r--r-- | src/server/requests.odin | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/server/requests.odin b/src/server/requests.odin index a775850..f9ef87b 100644 --- a/src/server/requests.odin +++ b/src/server/requests.odin @@ -539,34 +539,29 @@ read_ols_initialize_options :: proc(config: ^common.Config, ols_config: OlsConfi log.infof("resolved odin root to: %q", odin_core_env) - if "core" not_in config.collections && odin_core_env != "" { + if odin_core_env != "" { forward_path, _ := filepath.to_slash(odin_core_env, context.temp_allocator) + + // base + config.collections[strings.clone("base")] = path.join( + elems = {forward_path, "base"}, + allocator = context.allocator, + ) + + // core config.collections[strings.clone("core")] = path.join( elems = {forward_path, "core"}, allocator = context.allocator, ) - } - if "vendor" not_in config.collections && odin_core_env != "" { - forward_path, _ := filepath.to_slash(odin_core_env, context.temp_allocator) + // vendor config.collections[strings.clone("vendor")] = path.join( elems = {forward_path, "vendor"}, allocator = context.allocator, ) - } - - if "base" not_in config.collections && odin_core_env != "" { - forward_path, _ := filepath.to_slash(odin_core_env, context.temp_allocator) - config.collections[strings.clone("base")] = path.join( - elems = {forward_path, "base"}, - allocator = context.allocator, - ) - } - if "shared" not_in config.collections && odin_core_env != "" { - forward_path, _ := filepath.to_slash(odin_core_env, context.temp_allocator) + // shared shared_path := path.join(elems = {forward_path, "shared"}, allocator = context.allocator) - if os.exists(shared_path) { config.collections[strings.clone("shared")] = shared_path } else { |