mirror of
https://github.com/nukesor/pueue
synced 2024-09-06 16:03:26 +00:00
Add group to callback template
This commit is contained in:
parent
315a28d21a
commit
28e8b6d7b2
|
@ -242,6 +242,7 @@ These are the available variables that can be used to create a command:
|
|||
- `{{ command }}`
|
||||
- `{{ path }}`
|
||||
- `{{ result }}` (Success, Killed, etc.)
|
||||
- `{{ group }}`
|
||||
|
||||
Example callback:
|
||||
```
|
||||
|
|
|
@ -670,6 +670,11 @@ impl TaskHandler {
|
|||
parameters.insert("command", task.command.clone());
|
||||
parameters.insert("path", task.path.clone());
|
||||
parameters.insert("result", task.result.clone().unwrap().to_string());
|
||||
if let Some(group) = &task.group {
|
||||
parameters.insert("group", group.clone());
|
||||
} else {
|
||||
parameters.insert("group", "default".into());
|
||||
}
|
||||
let callback_command = match handlebars.render_template(&callback, ¶meters) {
|
||||
Ok(command) => command,
|
||||
Err(err) => {
|
||||
|
|
Loading…
Reference in a new issue