Task name vs template name #32
Replies: 1 comment 2 replies
-
I created a component called It should fit your workflow if I'm understanding it correctly. Let me know if this works as you want it to. If you run into any problems with the component, feel free to tell me, as I made this component pretty recently. To answer your original question, the name of the task depends on the template. You can have it have the same name as the template that created it as long as you specify that in the template definition. The task name is in the {
desc = 'Make this task restart when tasks with the same arbitrary attribute are run',
editable = false,
params = {
by = {
desc = 'The attribute to use to determine if two tasks are the same',
type = 'string',
optional = true,
default = 'name',
},
},
constructor = function(params)
return {
on_pre_start = function(_, task)
local tasks = require('overseer.task_list').list_tasks()
for _, t in ipairs(tasks) do
if t[params.by] == task[params.by] and t ~= task then
task:dispose(true)
t:restart(true)
return false
end
end
end,
}
end,
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
require("overseer.task_list").get_by_name(name)
expects the name to be the name of the command created by the template.Is there a way to have the tasks issued by a template to carry the same name as the template name?
I am thinking this workflow:
overseer.task_list.get_by_name
OverseerQuickAction restart
Right now I have one keybind to run a template by name. Pressing the key creates a new task of the same, as expected. Would be simpler if I could automate the above so that it precludes having to open overseer sidebar, choosing task and rerunning it manually.
Beta Was this translation helpful? Give feedback.
All reactions