mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Hooks
- Deferred JSON checking until after we know whether the hooks voluntarily failed the event.
This commit is contained in:
parent
e00704a375
commit
a2e980c6b8
1 changed files with 8 additions and 8 deletions
|
@ -258,12 +258,12 @@ void Hooks::onAdd (Task& task)
|
||||||
std::vector <std::string> outputFeedback;
|
std::vector <std::string> outputFeedback;
|
||||||
separateOutput (output, outputJSON, outputFeedback);
|
separateOutput (output, outputJSON, outputFeedback);
|
||||||
|
|
||||||
assertNTasks (outputJSON, 1);
|
|
||||||
assertValidJSON (outputJSON);
|
|
||||||
assertSameTask (outputJSON, task);
|
|
||||||
|
|
||||||
if (status == 0)
|
if (status == 0)
|
||||||
{
|
{
|
||||||
|
assertNTasks (outputJSON, 1);
|
||||||
|
assertValidJSON (outputJSON);
|
||||||
|
assertSameTask (outputJSON, task);
|
||||||
|
|
||||||
// Propagate forward to the next script.
|
// Propagate forward to the next script.
|
||||||
input[0] = outputJSON[0];
|
input[0] = outputJSON[0];
|
||||||
|
|
||||||
|
@ -327,12 +327,12 @@ void Hooks::onModify (const Task& before, Task& after)
|
||||||
std::vector <std::string> outputFeedback;
|
std::vector <std::string> outputFeedback;
|
||||||
separateOutput (output, outputJSON, outputFeedback);
|
separateOutput (output, outputJSON, outputFeedback);
|
||||||
|
|
||||||
assertNTasks (outputJSON, 1);
|
|
||||||
assertValidJSON (outputJSON);
|
|
||||||
assertSameTask (outputJSON, before);
|
|
||||||
|
|
||||||
if (status == 0)
|
if (status == 0)
|
||||||
{
|
{
|
||||||
|
assertNTasks (outputJSON, 1);
|
||||||
|
assertValidJSON (outputJSON);
|
||||||
|
assertSameTask (outputJSON, before);
|
||||||
|
|
||||||
// Propagate accepted changes forward to the next script.
|
// Propagate accepted changes forward to the next script.
|
||||||
input[1] = outputJSON[0];
|
input[1] = outputJSON[0];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue