mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
Refactor khoj-setup in khoj.el for readability. No functional change
This commit is contained in:
@@ -465,17 +465,19 @@ CONFIG is json obtained from Khoj config API."
|
|||||||
(permitted (if (and not-started interact)
|
(permitted (if (and not-started interact)
|
||||||
(y-or-n-p "Could not connect to Khoj server. Should I install, start and configure it for you?")
|
(y-or-n-p "Could not connect to Khoj server. Should I install, start and configure it for you?")
|
||||||
t)))
|
t)))
|
||||||
;; Install, start server if user permitted and server not ready
|
;; If user permits setup of khoj server from khoj.el
|
||||||
(when (and permitted not-started)
|
|
||||||
(khoj--server-setup))
|
|
||||||
|
|
||||||
;; Server can be started but not ready (to use/configure)
|
|
||||||
;; Wait until server is ready if setup was permitted
|
|
||||||
(while (and permitted (not khoj--server-ready?))
|
|
||||||
(sit-for 0.5))
|
|
||||||
|
|
||||||
;; Configure server once server ready if user permitted
|
|
||||||
(when permitted
|
(when permitted
|
||||||
|
; Install, start server if server not running
|
||||||
|
(when not-started
|
||||||
|
(khoj--server-setup))
|
||||||
|
|
||||||
|
;; Wait until server is ready
|
||||||
|
;; As server can be started but not ready to use/configure
|
||||||
|
(while (not khoj--server-ready?)
|
||||||
|
(message "Khoj: Waiting for server to start...")
|
||||||
|
(sit-for 0.5))
|
||||||
|
|
||||||
|
;; Configure server once it's ready
|
||||||
(khoj--server-configure))))
|
(khoj--server-configure))))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user