mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-01 09:17:19 +02:00
Hooks
- Correct handling for JSON and non-JSON output.
This commit is contained in:
parent
2ea9b8786e
commit
9996e5adef
1 changed files with 18 additions and 4 deletions
|
@ -112,7 +112,10 @@ void Hooks::onLaunch ()
|
|||
else
|
||||
{
|
||||
for (line = lines.begin (); line != lines.end (); ++line)
|
||||
context.error (*line);
|
||||
if (line->length () && (*line)[0] == '{')
|
||||
; // Ignored
|
||||
else
|
||||
context.error (*line);
|
||||
|
||||
throw 0; // This is how hooks silently terminate processing.
|
||||
}
|
||||
|
@ -162,7 +165,10 @@ void Hooks::onExit ()
|
|||
else
|
||||
{
|
||||
for (line = lines.begin (); line != lines.end (); ++line)
|
||||
context.error (*line);
|
||||
if (line->length () && (*line)[0] == '{')
|
||||
; // Ignored
|
||||
else
|
||||
context.error (*line);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,7 +231,12 @@ void Hooks::onAdd (Task& after)
|
|||
else
|
||||
{
|
||||
for (line = lines.begin (); line != lines.end (); ++line)
|
||||
context.error (*line);
|
||||
{
|
||||
if (line->length () && (*line)[0] == '{')
|
||||
; // Ignored
|
||||
else
|
||||
context.error (*line);
|
||||
}
|
||||
|
||||
throw 0; // This is how hooks silently terminate processing.
|
||||
}
|
||||
|
@ -294,7 +305,10 @@ void Hooks::onModify (const Task& before, Task& after)
|
|||
else
|
||||
{
|
||||
for (line = lines.begin (); line != lines.end (); ++line)
|
||||
context.error (*line);
|
||||
if (line->length () && (*line)[0] == '{')
|
||||
; // Ignored
|
||||
else
|
||||
context.error (*line);
|
||||
|
||||
throw 0; // This is how hooks silently terminate processing.
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue