mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Extensions
- Created scripts/extensions/README to describe samples. - Created sample extension scripts of each type.
This commit is contained in:
parent
bac4610580
commit
60a5d271f4
10 changed files with 335 additions and 55 deletions
|
@ -53,7 +53,6 @@
|
|||
#include <API.h>
|
||||
|
||||
extern Context context;
|
||||
Task* the_task = NULL;
|
||||
|
||||
#ifdef HAVE_LIBLUA
|
||||
|
||||
|
@ -122,6 +121,7 @@ static int api_task_set (lua_State* L)
|
|||
catch (...)
|
||||
{
|
||||
// TODO Error!
|
||||
lua_pushstring (L, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,16 +223,10 @@ bool API::callTaskHook (
|
|||
// Prepare args.
|
||||
lua_pushnumber (L, current.id);
|
||||
|
||||
// Expose the task.
|
||||
the_task = ¤t;
|
||||
|
||||
// Make call.
|
||||
if (lua_pcall (L, 1, 2, 0) != 0)
|
||||
throw std::string ("Error calling '") + function + "' - " + lua_tostring (L, -1) + ".";
|
||||
|
||||
// Hide the task.
|
||||
the_task = NULL;
|
||||
|
||||
// Call successful - get return values.
|
||||
if (!lua_isnumber (L, -2))
|
||||
throw std::string ("Error: '") + function + "' did not return a success indicator.";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue