Creating a template to run in a terminal #283
Replies: 1 comment
-
Did you ever figure it out? I'm trying to do the same thing. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I read through the doc and looked at the discussions. I can't find how to configure the task I needed.
I want to run the script run_tests.py in a terminal. I wrote the below recipe. But it doesn't seem to launch in terminal (or toggle_terminal).
return {
name = "Test executor",
builder = function(in_args)
local file = vim.fn.expand("%:p")
local cmd = { file }
local args = {}
if vim.bo.filetype == "python" then
---@diagnostic disable-next-line: cast-local-type
cmd = "scripts/execute_tests.py"
args = {
"--verbose",
}
end
if in_args then
-- for _, value in pairs(in_args) do
-- table.insert(args, value)
-- end
args = require("astrocore").extend_tbl(args, in_args)
end
return {
cmd = cmd,
cwd = vim.env.ws_root,
use_shell = true,
open_on_start = true,
quit_on_exit = false,
close_on_exit = false,
use_terminal = true,
-- https://github.com/stevearc/overseer.nvim/blob/master/doc/strategies.md#terminal
strategy = "terminal", -- is this correct
args = args,
components = {
{ "on_output_quickfix", set_diagnostics = true },
"on_result_diagnostics",
"default",
},
}
end,
condition = {
filetype = { "python" },
},
}
Beta Was this translation helpful? Give feedback.
All reactions