Fix absolute and relative paths

This commit is contained in:
Folkert Kevelam 2025-08-24 17:59:49 +02:00
parent c4f6e0a33d
commit 245f34e1e1

View File

@ -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