diff --git a/lua/MarkdownPreviewer/app.lua b/lua/MarkdownPreviewer/app.lua index 1d2e6af..5b5a36b 100644 --- a/lua/MarkdownPreviewer/app.lua +++ b/lua/MarkdownPreviewer/app.lua @@ -20,7 +20,8 @@ end app = { cmd = nil, - channel = nil + channel = nil, + cwd = nil } function app:init(on_exit) @@ -28,9 +29,9 @@ function app:init(on_exit) return end - local cwd = debug.getinfo(1, 'S').source:sub(2):match('(.*[/\\])') + self.cwd = debug.getinfo(1, 'S').source:sub(2):match('(.*[/\\])') self.channel = vim.fn.jobstart(self.cmd, { - cwd = cwd, + cwd = self.cwd, stderr_buffered = true, on_exit = function() vim.fn.chanclose(self.channel) @@ -75,11 +76,13 @@ function module.setup() setmetatable(o, app) app.__index = app + local cwd = debug.getinfo(1, 'S').source:sub(2):match('(.*[/\\])') + local base_location = cwd:gsub("lua/MarkdownPreviewer", "") + o.cmd = { - "../../Server/run.sh", - "../../Server/venv", - 'python3', - '../../Server/server.py' + base_location .. "Server/test.pex", + "--base", + base_location } return o