branch: externals/org-gnosis
commit 9be029348879f75c83d32072637877fa611e4beb
Author: Thanos Apollo <pub...@thanosapollo.org>
Commit: Thanos Apollo <pub...@thanosapollo.org>

    [fix] Create notes & journal directories
    
    * If notes & journal directories do not exist, create them upon
      loading this package.
---
 org-gnosis.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index e8e5575b24..bd97ec359e 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -37,7 +37,7 @@
 (defgroup org-gnosis nil
   "Note Taking System."
   :group 'external)
-
+;; is ~/Notes appropriate for all Operating Systems?
 (defcustom org-gnosis-dir (expand-file-name "Notes" "~")
   "Directory with gnosis notes."
   :type 'directory)
@@ -85,6 +85,11 @@
 
 (defvar org-gnosis-db (emacsql-sqlite-open (locate-user-emacs-file 
"org-gnosis.db")))
 
+;; Create notes & journal directories.
+(dolist (dir `(,org-gnosis-dir ,org-gnosis-journal-dir))
+  (unless (file-directory-p dir)
+    (make-directory dir)))
+
 (cl-defun org-gnosis-select (value table &optional (restrictions '1=1) 
(flatten nil))
   "Select VALUE from TABLE, optionally with RESTRICTIONS.
 

Reply via email to