From 2ed4e0d55cfbbfa2fe1b329b3176b663aa53b94d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 20 Dec 2019 20:47:13 -0500 Subject: [PATCH] bin/doom: warn if run as root --- bin/doom | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/doom b/bin/doom index 47dc9b7cd..36bb10582 100755 --- a/bin/doom +++ b/bin/doom @@ -54,6 +54,14 @@ with a different private module." (push command args) (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. (when (or emacsdir doomdir localdir) (load! "core/core.el" user-emacs-directory))