- Enumerates installed hook scripts and sorts it, thus defining the
  execution sequence.
This commit is contained in:
Paul Beckingham 2014-05-13 18:58:15 -04:00
parent 446fd88b8b
commit f1451b2670

View file

@ -25,6 +25,7 @@
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#include <cmake.h> #include <cmake.h>
#include <algorithm>
#include <Context.h> #include <Context.h>
#include <Hooks.h> #include <Hooks.h>
@ -45,8 +46,13 @@ void Hooks::initialize ()
{ {
// Scan <rc.data.location>/hooks // Scan <rc.data.location>/hooks
Directory d (context.config.get ("data.location")); Directory d (context.config.get ("data.location"));
if (d.cd ("hooks")) d += "hooks";
if (d.is_directory () &&
d.readable ())
{
_scripts = d.list (); _scripts = d.list ();
std::sort (_scripts.begin (), _scripts.end ());
}
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -70,5 +76,4 @@ void Hooks::onExit ()
context.timer_hooks.stop (); context.timer_hooks.stop ();
} }
// TODO Time the hook runs.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////