diff options
| author | David Bremner <david@tethera.net> | 2021-01-10 07:50:14 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-02-06 19:57:55 -0400 |
| commit | f61d88c6f454c368282ac881a864f619a409ba42 (patch) | |
| tree | 428ddda15e9551b3aacdb9426ee7c875ec2e0549 /hooks.c | |
| parent | 0345bc57a0d00d576c0e8bccc23fd448736a4511 (diff) | |
CLI: use configured hook directory
This enables support for hooks outside the database directory.
It relies strongly on configuration information being usable between
closing the database and destroying it.
Diffstat (limited to 'hooks.c')
| -rw-r--r-- | hooks.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -24,14 +24,15 @@ #include <sys/wait.h> int -notmuch_run_hook (const char *db_path, const char *hook) +notmuch_run_hook (notmuch_database_t *notmuch, const char *hook) { char *hook_path; int status = 0; pid_t pid; - hook_path = talloc_asprintf (NULL, "%s/%s/%s/%s", db_path, ".notmuch", - "hooks", hook); + hook_path = talloc_asprintf (notmuch, "%s/%s", + notmuch_config_get (notmuch, NOTMUCH_CONFIG_HOOK_DIR), + hook); if (hook_path == NULL) { fprintf (stderr, "Out of memory\n"); return 1; |
