aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2022-07-23 15:54:34 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2022-07-23 15:54:34 +0200
commitd69761f1dc75599b1314a368ae98590ff79bb4c8 (patch)
treeabb39f483876a89eced0387f0642b14457ef0f54 /src/server
parent952de6f87060a596a8dbd919b34e9225fb4357c9 (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.odin6
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)