mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Hooks
- ::onExit now provides a set of all changeѕ tasks to the hook script, in read-only form.
This commit is contained in:
parent
d0fd3bac4a
commit
bfc6e38851
3 changed files with 39 additions and 3 deletions
|
@ -157,11 +157,18 @@ void Hooks::onExit ()
|
|||
|
||||
context.timer_hooks.start ();
|
||||
|
||||
std::vector <Task> changes;
|
||||
context.tdb2.get_changes (changes);
|
||||
|
||||
std::string input;
|
||||
std::vector <Task>::const_iterator t;
|
||||
for (t = changes.begin (); t != changes.end (); ++t)
|
||||
input += t->composeJSON () + "\n";
|
||||
|
||||
std::vector <std::string> matchingScripts = scripts ("on-exit");
|
||||
std::vector <std::string>::iterator i;
|
||||
for (i = matchingScripts.begin (); i != matchingScripts.end (); ++i)
|
||||
{
|
||||
std::string input;
|
||||
std::string output;
|
||||
std::vector <std::string> args;
|
||||
int status = execute (*i, args, input, output);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue