fix(cli): reading dir perms on a non-existent dir
This is a regression fromc05e615
. doom.el changes user-emacs-directory to doom-cache-dir, which may not exist yet, at the time of this check, causing file-attributes to return nil, and causing = to throw a type error (see #6754). In addition to fixing this, I've also made the check more liberal about failures, in the odd case that doom-emacs-dir, too, does not exist at the time bin/doom is called (it'd be very hard to pull that off, but not impossible). Fix: #6754 Amend:c05e61536e
This commit is contained in:
parent
18887163f9
commit
ceae154751
1 changed files with 3 additions and 3 deletions
6
bin/doom
6
bin/doom
|
@ -88,8 +88,8 @@
|
|||
;; UX: Abort if the user is using 'doom' as root, unless ~/.emacs.d is owned by
|
||||
;; root, in which case we assume the user genuinely wants root to be their
|
||||
;; primary user account for Emacs.
|
||||
(when (equal (user-real-uid) 0)
|
||||
(unless (= 0 (file-attribute-user-id (file-attributes user-emacs-directory)))
|
||||
(when (equal 0 (user-real-uid))
|
||||
(unless (equal 0 (file-attribute-user-id (file-attributes doom-emacs-dir)))
|
||||
(message
|
||||
(concat
|
||||
"Error: this script was executed as root, which is likely not what you want.\n"
|
||||
|
@ -98,7 +98,7 @@
|
|||
"If this really *is* what you want, then change the owner of your Emacs\n"
|
||||
"config to root:\n\n"
|
||||
;; TODO Add cmd.exe/powershell commands
|
||||
" chown root:root -R " (abbreviate-file-name user-emacs-directory) "\n\n"
|
||||
" chown root:root -R " (abbreviate-file-name doom-emacs-dir) "\n\n"
|
||||
"Aborting..."))
|
||||
(kill-emacs 2)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue