Skip to content

Commit

Permalink
feat: fix template to set working dir for task
Browse files Browse the repository at this point in the history
  • Loading branch information
hori-ryota committed May 25, 2024
1 parent 68a2d34 commit e8dec44
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lua/overseer/template/task.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ local template = {
target = { optional = false, type = "string", desc = "target" },
---@type overseer.ListParam
args = { optional = true, type = "list", delimiter = " " },
---@type overseer.StringParam
cwd = { optional = true },
},
builder = function(params)
local cmd = { "task" }
Expand All @@ -35,7 +37,10 @@ local template = {
end

---@type overseer.TaskDefinition
local task = { cmd = cmd }
local task = {
cmd = cmd,
cwd = params.cwd,
}

if params.args then
task.args = vim.list_extend({ "--" }, params.args)
Expand Down Expand Up @@ -85,7 +90,10 @@ local provider = {
if target.name == "default" then
override.priority = 55
end
table.insert(ret, overseer.wrap_template(template, override, { target = target.name }))
table.insert(
ret,
overseer.wrap_template(template, override, { target = target.name, cwd = opts.dir })
)
end
cb(ret)
end),
Expand Down

0 comments on commit e8dec44

Please sign in to comment.