Skip to content

Commit

Permalink
fix(mix): invoke in the folder of the mix.exs (#241)
Browse files Browse the repository at this point in the history
* mix: invoke in the folder of the mix.exs

* refactor: use get_mix_file helper function

* lint: fix type error

---------

Co-authored-by: Steven Arcangeli <[email protected]>
  • Loading branch information
emmanueltouzery and stevearc authored Dec 23, 2023
1 parent 9e6fe0e commit 27795de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/overseer/template/mix.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ return {
end,
},
generator = function(opts, cb)
-- mix will not return all the tasks unless you invoke it in the mix.exs folder
local mix_folder = vim.fs.dirname(assert(get_mix_file(opts)))
local ret = {}
local jid = vim.fn.jobstart({
"mix",
"help",
}, {
cwd = opts.dir,
cwd = mix_folder,
stdout_buffered = true,
on_stdout = vim.schedule_wrap(function(j, output)
for _, line in ipairs(output) do
Expand Down

0 comments on commit 27795de

Please sign in to comment.