Set exec-path/shell-file-name in doom-load-env-vars
And perform file-readable-p check inside doom-load-env-vars
This commit is contained in:
parent
12fa049012
commit
ae365272ad
2 changed files with 11 additions and 16 deletions
|
@ -56,12 +56,7 @@ Uses the same mechanism as 'bin/doom env reload'."
|
||||||
(sit-for 1))
|
(sit-for 1))
|
||||||
(unless (file-readable-p doom-env-file)
|
(unless (file-readable-p doom-env-file)
|
||||||
(error "Failed to generate env file"))
|
(error "Failed to generate env file"))
|
||||||
(doom-load-env-vars doom-env-file)
|
(doom-load-env-vars doom-env-file))
|
||||||
(setq-default
|
|
||||||
exec-path (append (split-string (getenv "PATH") ":")
|
|
||||||
(list exec-directory))
|
|
||||||
shell-file-name (or (getenv "SHELL")
|
|
||||||
shell-file-name)))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/reload-font ()
|
(defun doom/reload-font ()
|
||||||
|
|
20
core/core.el
20
core/core.el
|
@ -429,7 +429,8 @@ in interactive sessions, nil otherwise (but logs a warning)."
|
||||||
|
|
||||||
(defun doom-load-env-vars (file)
|
(defun doom-load-env-vars (file)
|
||||||
"Read and set envvars in FILE."
|
"Read and set envvars in FILE."
|
||||||
(let (vars)
|
(if (not (file-readable-p file))
|
||||||
|
(doom-log "Couldn't read %S envvar file" file)
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents file)
|
(insert-file-contents file)
|
||||||
(re-search-forward "\n\n" nil t)
|
(re-search-forward "\n\n" nil t)
|
||||||
|
@ -442,7 +443,12 @@ in interactive sessions, nil otherwise (but logs a warning)."
|
||||||
(line-beginning-position))
|
(line-beginning-position))
|
||||||
(point-max))))))
|
(point-max))))))
|
||||||
(setenv var value)))))
|
(setenv var value)))))
|
||||||
vars))
|
(setq exec-path (append (split-string (getenv "PATH")
|
||||||
|
(if IS-WINDOWS ";" ":"))
|
||||||
|
(list exec-directory))
|
||||||
|
shell-file-name (or (getenv "SHELL")
|
||||||
|
shell-file-name))
|
||||||
|
t))
|
||||||
|
|
||||||
(defun doom-initialize (&optional force-p)
|
(defun doom-initialize (&optional force-p)
|
||||||
"Bootstrap Doom, if it hasn't already (or if FORCE-P is non-nil).
|
"Bootstrap Doom, if it hasn't already (or if FORCE-P is non-nil).
|
||||||
|
@ -510,14 +516,8 @@ to least)."
|
||||||
(user-error "Your package autoloads are missing! Run `bin/doom refresh' to regenerate them")))
|
(user-error "Your package autoloads are missing! Run `bin/doom refresh' to regenerate them")))
|
||||||
|
|
||||||
;; Load shell environment
|
;; Load shell environment
|
||||||
(when (and (not noninteractive)
|
(unless noninteractive
|
||||||
(file-readable-p doom-env-file))
|
(doom-load-env-vars doom-env-file)))
|
||||||
(doom-load-env-vars doom-env-file)
|
|
||||||
(setq exec-path (append (split-string (getenv "PATH")
|
|
||||||
(if IS-WINDOWS ";" ":"))
|
|
||||||
(list exec-directory))
|
|
||||||
shell-file-name (or (getenv "SHELL")
|
|
||||||
shell-file-name))))
|
|
||||||
|
|
||||||
(require 'core-modules)
|
(require 'core-modules)
|
||||||
(require 'core-os)
|
(require 'core-os)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue