]> git.notmuchmail.org Git - notmuch/blobdiff - lib/open.cc
lib/open: support NOTMUCH_DATABASE environment variable
[notmuch] / lib / open.cc
index d05a19a76c2336515bcea293e7ab0d5ce5691613..6e46168a78d20a8418e3b7535c4a464c7813aa87 100644 (file)
@@ -168,6 +168,10 @@ _choose_database_path (void *ctx,
        return status;
     }
 
+    if (! *database_path) {
+       *database_path = getenv ("NOTMUCH_DATABASE");
+    }
+
     if (! *database_path && *key_file) {
        char *path = g_key_file_get_value (*key_file, "database", "path", NULL);
        if (path) {