Skip to content

Commit

Permalink
Update the 'Run script' overseer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jendker committed Dec 1, 2024
1 parent 1573a2d commit 8de52fd
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@ return {
name = "run script",
builder = function()
local file = vim.fn.expand("%:p")
local cmd = { file }
if vim.bo.filetype == "go" then
cmd = { "go", "run", file }
local filetype_cmds = {
go = { "go", "run" },
python = { "python" },
sh = { "bash" },
}

local filetype = vim.bo.filetype
local cmd = filetype_cmds[filetype]

if cmd then
table.insert(cmd, file)
else
vim.notify("Oversser template - Unsupported filetype: " .. filetype)
end
return {
cmd = cmd,
Expand Down

0 comments on commit 8de52fd

Please sign in to comment.