mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Hooks
- Modified ::onExit to remove the indicator that data was modified. This is not supported.
This commit is contained in:
parent
a9cf61c1d1
commit
5ce317bb48
3 changed files with 3 additions and 8 deletions
|
@ -284,8 +284,7 @@ int Context::run ()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
rc = dispatch (output);
|
rc = dispatch (output);
|
||||||
if (hooks.onExit ())
|
hooks.onExit ();
|
||||||
tdb2.commit ();
|
|
||||||
|
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << "Perf "
|
s << "Perf "
|
||||||
|
|
|
@ -136,13 +136,10 @@ void Hooks::onLaunch ()
|
||||||
// Exit:
|
// Exit:
|
||||||
// 0 Means: - all emitted non-JSON lines become footnote entries
|
// 0 Means: - all emitted non-JSON lines become footnote entries
|
||||||
// non-0 Means: - all emitted non-JSON lines become error entries
|
// non-0 Means: - all emitted non-JSON lines become error entries
|
||||||
bool Hooks::onExit ()
|
void Hooks::onExit ()
|
||||||
{
|
{
|
||||||
context.timer_hooks.start ();
|
context.timer_hooks.start ();
|
||||||
|
|
||||||
// Status indicates whether hooks resulted in new/modified tasks.
|
|
||||||
bool status = false;
|
|
||||||
|
|
||||||
std::vector <std::string> matchingScripts = scripts ("on-exit");
|
std::vector <std::string> matchingScripts = scripts ("on-exit");
|
||||||
std::vector <std::string>::iterator i;
|
std::vector <std::string>::iterator i;
|
||||||
for (i = matchingScripts.begin (); i != matchingScripts.end (); ++i)
|
for (i = matchingScripts.begin (); i != matchingScripts.end (); ++i)
|
||||||
|
@ -169,7 +166,6 @@ bool Hooks::onExit ()
|
||||||
}
|
}
|
||||||
|
|
||||||
context.timer_hooks.stop ();
|
context.timer_hooks.stop ();
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
void initialize ();
|
void initialize ();
|
||||||
|
|
||||||
void onLaunch ();
|
void onLaunch ();
|
||||||
bool onExit ();
|
void onExit ();
|
||||||
void onAdd (Task&);
|
void onAdd (Task&);
|
||||||
void onModify (const Task&, Task&);
|
void onModify (const Task&, Task&);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue