-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathovs.lua
More file actions
70 lines (67 loc) · 1.63 KB
/
ovs.lua
File metadata and controls
70 lines (67 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
local M = {}
M.config = function()
local status_ok, see = pcall(require, "overseer")
if not status_ok then
return
end
local STATUS = require("overseer.constants").STATUS
see.setup {
templates = { builtin = true },
strategy = { "jobstart" },
task_list = {
bindings = {
dd = "Dispose",
},
},
task_launcher = {
bindings = {
n = {
["<leader>c"] = "Cancel",
},
},
},
log = {
{
type = "echo",
level = vim.log.levels.WARN,
},
{
type = "file",
filename = "overseer.log",
level = vim.log.levels.DEBUG,
},
},
component_aliases = {
default = {
"on_output_summarize",
"on_exit_set_status",
{ "on_complete_notify", system = "unfocused" },
"on_complete_dispose",
{ "display_duration", detail_level = 2 },
},
default_neotest = {
"unique",
{ "on_complete_notify", system = "unfocused", on_change = true },
"default",
},
},
actions = {
["keep runnning"] = {
desc = "restart the task even if it succeeds",
run = function(task)
task:add_components { { "on_complete_restart", statuses = { STATUS.FAILURE, STATUS.SUCCESS } } }
if task.status == STATUS.FAILURE or task.status == STATUS.SUCCESS then
task:restart()
end
end,
},
["don't dispose"] = {
desc = "keep the task until manually disposed",
run = function(task)
task:remove_components { "on_complete_dispose" }
end,
},
},
}
end
return M