mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Enhancement - Hooks
- Multiple hooks for the same event are now triggered, in the sequence they are found in .taskrc - Program hooks can now cause task to exit.
This commit is contained in:
parent
69cae7731f
commit
78063c4df7
3 changed files with 13 additions and 10 deletions
|
@ -490,10 +490,9 @@ bool API::callProgramHook (
|
|||
throw std::string ("Error calling '") + function + "' - " + lua_tostring (L, -1);
|
||||
|
||||
// Call successful - get return values.
|
||||
// 0, nil -> success
|
||||
// 0, string -> warning
|
||||
// 1, string -> error
|
||||
if (!lua_isnumber (L, -2)) throw std::string ("Error: '") + function + "' did not return a success indicator";
|
||||
|
||||
// TODO This doesn't seem to know that 'nil' was returned instead of a string.
|
||||
// if (!lua_isstring (L, -1)) throw std::string ("Error: '") + function + "' did not return a message";
|
||||
|
||||
int rc = lua_tointeger (L, -2);
|
||||
|
@ -507,7 +506,7 @@ bool API::callProgramHook (
|
|||
else
|
||||
{
|
||||
if (message)
|
||||
throw std::string ("Error: ") + message;
|
||||
throw std::string (message);
|
||||
}
|
||||
|
||||
lua_pop (L, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue