mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 20:37:20 +02:00
Hooks
- Added a master control, rc.hooks, which defaults to 'on', but can be used to disable hook processing in general.
This commit is contained in:
parent
150f72eed4
commit
78650ac8c3
6 changed files with 21 additions and 7 deletions
|
@ -64,6 +64,7 @@ std::string Config::_defaults =
|
|||
"locking=on # Use file-level locking\n"
|
||||
"gc=on # Garbage-collect data files - DO NOT CHANGE unless you are sure\n"
|
||||
"exit.on.missing.db=no # Whether to exit if ~/.task is not found\n"
|
||||
"hooks=on # Master control switch for hooks\n"
|
||||
"\n"
|
||||
"# Terminal\n"
|
||||
"detection=on # Detects terminal width\n"
|
||||
|
|
|
@ -55,14 +55,17 @@ Hooks::~Hooks ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Hooks::initialize ()
|
||||
{
|
||||
// Scan <rc.data.location>/hooks
|
||||
Directory d (context.config.get ("data.location"));
|
||||
d += "hooks";
|
||||
if (d.is_directory () &&
|
||||
d.readable ())
|
||||
if (context.config.getBoolean ("hooks"))
|
||||
{
|
||||
_scripts = d.list ();
|
||||
std::sort (_scripts.begin (), _scripts.end ());
|
||||
// Scan <rc.data.location>/hooks
|
||||
Directory d (context.config.get ("data.location"));
|
||||
d += "hooks";
|
||||
if (d.is_directory () &&
|
||||
d.readable ())
|
||||
{
|
||||
_scripts = d.list ();
|
||||
std::sort (_scripts.begin (), _scripts.end ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -154,6 +154,7 @@ int CmdShow::execute (std::string& output)
|
|||
" extensions"
|
||||
" fontunderline"
|
||||
" gc"
|
||||
" hooks"
|
||||
" hyphenate"
|
||||
" indent.annotation"
|
||||
" indent.report"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue