mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-07 22:58:34 +02:00
Hooks
- Enumerates installed hook scripts and sorts it, thus defining the execution sequence.
This commit is contained in:
parent
446fd88b8b
commit
f1451b2670
1 changed files with 7 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <algorithm>
|
||||
#include <Context.h>
|
||||
#include <Hooks.h>
|
||||
|
||||
|
@ -45,8 +46,13 @@ void Hooks::initialize ()
|
|||
{
|
||||
// Scan <rc.data.location>/hooks
|
||||
Directory d (context.config.get ("data.location"));
|
||||
if (d.cd ("hooks"))
|
||||
d += "hooks";
|
||||
if (d.is_directory () &&
|
||||
d.readable ())
|
||||
{
|
||||
_scripts = d.list ();
|
||||
std::sort (_scripts.begin (), _scripts.end ());
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -70,5 +76,4 @@ void Hooks::onExit ()
|
|||
context.timer_hooks.stop ();
|
||||
}
|
||||
|
||||
// TODO Time the hook runs.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue