diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-04-05 20:03:00 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2025-04-05 20:03:00 +0200 |
| commit | e8cf1cac42316248cf2fe8d7aea486cf8d5affed (patch) | |
| tree | 23110ec633bf4f217569bee7087537b622a702c5 /src | |
| parent | a500226c10e991506c42a4858ffd7d1d33f552e6 (diff) | |
| parent | b12c542e1a1203a3a1dd19a600e526eb1db702b8 (diff) | |
Merge branch 'master' of https://github.com/DanielGavin/ols
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/requests.odin | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/server/requests.odin b/src/server/requests.odin index f4e2d4b..0cd684d 100644 --- a/src/server/requests.odin +++ b/src/server/requests.odin @@ -469,6 +469,15 @@ read_ols_initialize_options :: proc(config: ^common.Config, ols_config: OlsConfi odin_core_env: string odin_bin := "odin" if config.odin_command == "" else config.odin_command + // If we don't have an absolute path + if !filepath.is_abs(odin_bin) { + // Join with the project path + tmp_path := path.join(elems = {uri.path, odin_bin}) + if os.exists(tmp_path) { + odin_bin = tmp_path + } + } + root_buf: [1024]byte root_slice := root_buf[:] root_command := strings.concatenate({odin_bin, " root"}, context.temp_allocator) @@ -482,7 +491,7 @@ read_ols_initialize_options :: proc(config: ^common.Config, ols_config: OlsConfi odin_core_env = os.get_env("ODIN_ROOT", context.temp_allocator) if odin_core_env == "" { - if filepath.is_abs(odin_bin) { + if os.exists(odin_bin) { odin_core_env = filepath.dir(odin_bin, context.temp_allocator) } else if exe_path, ok := common.lookup_in_path(odin_bin); ok { odin_core_env = filepath.dir(exe_path, context.temp_allocator) |