Add helper function for running jj commands
This commit is contained in:
parent
b4672972dc
commit
c2aafde0c8
@ -2,6 +2,21 @@
|
||||
|
||||
local M = {}
|
||||
|
||||
-- Helper function to run jj commands
|
||||
local function _run_jj_command(args)
|
||||
local cmd = "jj " .. table.concat(args, " ")
|
||||
local handle = io.popen(cmd)
|
||||
if not handle then
|
||||
return nil, "Failed to run command: " .. cmd
|
||||
end
|
||||
local output = handle:read("*a")
|
||||
local status = handle:close()
|
||||
if not status then
|
||||
return nil, "Command failed: " .. cmd
|
||||
end
|
||||
return output
|
||||
end
|
||||
|
||||
function M.setup(opts)
|
||||
opts = opts or {}
|
||||
-- TODO: Implement configuration options
|
||||
|
||||
Loading…
Reference in New Issue
Block a user