bin/doom: warn if run as root

This commit is contained in:
Henrik Lissner 2019-12-20 20:47:13 -05:00
parent 1cb8ec6302
commit 2ed4e0d55c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -54,6 +54,14 @@ with a different private module."
(push command args) (push command args)
(setq command "help")) (setq command "help"))
(when (equal (user-real-uid) 0)
(message
(concat "WARNING: This script is running as root. This isn't necessary and is likely\n"
"unintentional. It will cause file permissions errors later if you use this\n"
"Doom installation on a non-root account.\n"))
(unless (or doom-auto-accept (y-or-n-p "Continue anyway?"))
(user-error "Aborted")))
;; Reload core in case any of the directories were changed. ;; Reload core in case any of the directories were changed.
(when (or emacsdir doomdir localdir) (when (or emacsdir doomdir localdir)
(load! "core/core.el" user-emacs-directory)) (load! "core/core.el" user-emacs-directory))