diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-07-23 15:54:34 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-07-23 15:54:34 +0200 |
| commit | d69761f1dc75599b1314a368ae98590ff79bb4c8 (patch) | |
| tree | abb39f483876a89eced0387f0642b14457ef0f54 /src/server | |
| parent | 952de6f87060a596a8dbd919b34e9225fb4357c9 (diff) | |
Make ols more robust by also looking in the path environment for odin
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/requests.odin | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/requests.odin b/src/server/requests.odin index af03d90..47f0d74 100644 --- a/src/server/requests.odin +++ b/src/server/requests.odin @@ -449,6 +449,12 @@ request_initialize :: proc (params: json.Value, id: RequestId, config: ^common.C odin_core_env := os.get_env("ODIN_ROOT", context.temp_allocator) + if odin_core_env == "" && "core" not_in config.collections { + if exe_path, ok := common.lookup_in_path("odin"); ok { + odin_core_env = path.dir(exe_path, context.temp_allocator) + } + } + if "core" not_in config.collections && odin_core_env != "" { forward_path, _ := filepath.to_slash(odin_core_env, context.temp_allocator) config.collections["core"] = path.join(elems = {forward_path, "core"}, allocator = context.allocator) |