diff --git a/lua/cord/core/ipc.lua b/lua/cord/core/ipc.lua index 3da741a6..7d1aac69 100644 --- a/lua/cord/core/ipc.lua +++ b/lua/cord/core/ipc.lua @@ -27,18 +27,24 @@ function IPC:connect(callback) vim.schedule_wrap(function(err) if err then if err == 'ENOENT' then - local executable = self.config.advanced.server.executable_path + if self.config.advanced.server.executable_path then + self.executable = self.config.advanced.server.executable_path + else + self.executable = utils.os_name == 'Windows' + and 'target/release/cord.exe' + or 'target/release/cord' + end - if not utils.file_exists(executable) then + if not utils.file_exists(self.executable) then logger.error( - 'Server executable not found at \'' .. executable .. '\'' + 'Server executable not found at \'' .. self.executable .. '\'' ) return end local stdout = uv.new_pipe() local stderr = uv.new_pipe() - uv.spawn(executable, { + uv.spawn(self.executable, { args = { '-p', self.path, diff --git a/lua/cord/util/config.lua b/lua/cord/util/config.lua index 161d8edd..b61809d7 100644 --- a/lua/cord/util/config.lua +++ b/lua/cord/util/config.lua @@ -69,7 +69,7 @@ M.values = { advanced = { server = { pipe_path = nil, - executable_path = 'target/release/cord.exe', + executable_path = nil, timeout = 60000, }, cursor_update_mode = 'on_move',