Start with luadebug

This commit is contained in:
2025-10-23 23:13:48 +02:00
parent 8cde56a4e8
commit 1cd7b378b6
5 changed files with 94 additions and 24 deletions

View File

@ -7,14 +7,19 @@ local M = {
}
-- Run a shell command
---@param cmd table|string List of command pieces or in full
---@param opts table Options to run the command. Should contain env (table), cwd (string), stdout and stdin
---@param target table Target table
---@param name string Name of the target to run
---@return process|nil
function M:run(cmd, opts, name)
function M:run(target, name)
core.log("[jpdebug] Running shell command")
if cmd then
local proc = process.start(cmd, opts)
local opts = {
cwd = target.cwd or ".",
env = target.env or {},
stdout = process.REDIRECT_PIPE,
stderr = process.REDIRECT_PIPE
}
if target.cmd then
local proc = process.start(target.cmd, opts)
return proc
else
core.error("[jpdebug] command not specified for target %s", name)