Skip to content

Commit

Permalink
fix: pass config file dir as cwd for cargo-make and deno template
Browse files Browse the repository at this point in the history
  • Loading branch information
nazo6 committed Aug 5, 2024
1 parent cbcdcba commit fa2b4af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lua/overseer/template/cargo-make.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ return {
cb(ret)
return
end
local cargo_make_file_dir = vim.fs.dirname(cargo_make_file)

local data = files.read_file(cargo_make_file)
if not data then
Expand All @@ -65,7 +66,7 @@ return {
overseer.wrap_template(
tmpl,
{ name = string.format("cargo-make %s", task_name) },
{ args = { task_name } }
{ args = { task_name }, cwd = cargo_make_file_dir }
)
)
end
Expand Down
3 changes: 2 additions & 1 deletion lua/overseer/template/deno.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ return {
},
generator = function(opts, cb)
local package = get_deno_file(opts)
local package_dir = vim.fs.dirname(package)
local data = files.load_json_file(package)
local ret = {}
local tasks = data.tasks
Expand All @@ -50,7 +51,7 @@ return {
overseer.wrap_template(
tmpl,
{ name = string.format("deno %s", k) },
{ args = { "task", k } }
{ args = { "task", k }, cwd = package_dir }
)
)
end
Expand Down

0 comments on commit fa2b4af

Please sign in to comment.