fix: doom/reload 404ing on executables
Half-revertsc2c6a64
, which tried to get doom/reload to regenerate the envvar file from within Emacs, but running an environment scraper in a bare environment is really hard to get right. Ideally, your shell config should set up your environment, but there are too many edge cases or poor configs in the wild to depend on this. I've brought back doom/reload-env, but only to reload the envvar file -- *not* regenerate it. I've given up on trying to do that from within Emacs. Fix #5344 Refc2c6a64118
This commit is contained in:
parent
2c4328ccf0
commit
9687c04a84
1 changed files with 15 additions and 14 deletions
|
@ -76,21 +76,9 @@ Runs `doom-after-reload-hook' afterwards."
|
|||
(interactive)
|
||||
(mapc #'require (cdr doom-incremental-packages))
|
||||
(doom--if-compile (format "%S sync" doom-bin)
|
||||
(let ((doom-reloading-p t))
|
||||
(let ((doom-reloading-p t)
|
||||
doom-env-file)
|
||||
(doom-run-hooks 'doom-before-reload-hook)
|
||||
(when (file-readable-p doom-env-file)
|
||||
(if IS-WINDOWS
|
||||
(message "Can't regenerate envvar file from within Emacs in Windows. Skipping...")
|
||||
(let (process-environment)
|
||||
(doom--if-compile
|
||||
(format "%s -ic '%S env'"
|
||||
(string-trim
|
||||
(shell-command-to-string
|
||||
(format "getent passwd %S | cut -d: -f7"
|
||||
(user-login-name))))
|
||||
doom-bin)
|
||||
(message "Successfully regenerated envvar file")
|
||||
(error "Failed to generate env file")))))
|
||||
(doom-initialize 'force)
|
||||
(with-demoted-errors "PRIVATE CONFIG ERROR: %s"
|
||||
(general-auto-unbind-keys)
|
||||
|
@ -117,6 +105,19 @@ line."
|
|||
(doom-initialize-packages)
|
||||
(doom-autoloads-reload))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/reload-env ()
|
||||
"Reloads your envvar file.
|
||||
|
||||
DOES NOT REGENERATE IT. You must run 'doom env' in your shell OUTSIDE of Emacs.
|
||||
Doing so from within Emacs will taint your shell environment.
|
||||
|
||||
An envvar file contains a snapshot of your shell environment, which can be
|
||||
imported into Emacs."
|
||||
(interactive "P")
|
||||
(doom-load-envvars-file doom-env-file)
|
||||
(message "Reloaded %S" (abbreviate-file-name doom-env-file)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/upgrade ()
|
||||
"Run 'doom upgrade' then prompt to restart Emacs."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue