summaryrefslogtreecommitdiff
path: root/org-roam-ui.el
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-07-31 16:47:55 +0200
committerThomas F. K. Jorna <[email protected]>2021-07-31 16:47:55 +0200
commitc7fa8a6d18580f8c621ae857c82c8858d28a94a6 (patch)
treee387882733cdd8d4a034c5b76abaebee8211207a /org-roam-ui.el
parent016c0f67af5e89c20758b4eb5d59748e25fb91e4 (diff)
fixed root directiory being set incorrectly
Diffstat (limited to 'org-roam-ui.el')
-rw-r--r--org-roam-ui.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el
index b606e99..fed7bf3 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -44,10 +44,15 @@
:prefix "org-roam-ui-"
:link '(url-link :tag "Github" "https://github.com/org-roam/org-roam-ui"))
-(defvar org-roam-ui/root-dir default-directory
+(defvar org-roam-ui/root-dir
+ (concat (file-name-directory
+ (f-full (or
+ load-file-name
+ buffer-file-name)))
+ ".")
"Root directory of the org-roam-ui project.")
-(defvar org-roam-ui/app-build-dir (expand-file-name "./out/")
+(defvar org-roam-ui/app-build-dir (expand-file-name "./out/" org-roam-ui/root-dir)
"Directory containing org-roam-ui's web build.")
;; TODO: make into defcustom
@@ -102,8 +107,8 @@ This serves the web-build and API over HTTP."
:init-value nil
(cond
(org-roam-ui-mode
- (setq httpd-port org-roam-ui-port
- httpd-root org-roam-ui/app-build-dir)
+ (setq-local httpd-port org-roam-ui-port)
+ (setq httpd-root org-roam-ui/app-build-dir)
(httpd-start)
(setq org-roam-ui-ws
(websocket-server
@@ -123,8 +128,9 @@ This serves the web-build and API over HTTP."
(t
(progn
(websocket-server-close org-roam-ui-ws)
+ (httpd-stop)
(org-roam-ui-follow-mode -1)
- (httpd-stop)))))
+ ))))
(defun org-roam-ui--on-save ()
"Send graphdata on saving an org-roam buffer."