From 8d0c523effb083fd34e12948cde4756f89a7e7a2 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 22 Feb 2020 23:44:49 +0000 Subject: [PATCH] chore(core): Improve environment setup With my shell setup cleaned up so all environment variables are set in `~/.zshenv`, and all the slower interactive shell setup in `~/.zshrc`, we can no remove the `-i` flag from exec-path-from-shell's setup, leading to a much faster setup time. Also load additional environment variables, and also set `temporary-file-directory` to match the `TMPDIR` environment variable. --- core/siren-core-env.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/siren-core-env.el b/core/siren-core-env.el index 638fe11..aad4333 100644 --- a/core/siren-core-env.el +++ b/core/siren-core-env.el @@ -8,9 +8,24 @@ ;;; Code: (use-package exec-path-from-shell + :custom + (exec-path-from-shell-variables '("PATH" + "MANPATH" + "TMPDIR" + "GOPATH" + "KUBECONFIG")) + (exec-path-from-shell-arguments '("-l")) + (exec-path-from-shell-check-startup-files nil) + (exec-path-from-shell-debug nil) + :config (when (memq window-system '(mac ns x)) (exec-path-from-shell-initialize))) +;; Set temporary-file-directory to match TMPDIR environment variable +(let ((tmpdir (getenv "TMPDIR"))) + (when (and tmpdir (not (string-blank-p tmpdir))) + (setq temporary-file-directory tmpdir))) + (provide 'siren-core-env) ;;; siren-core-env.el ends here