Start with luadebug
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user