diff --git a/bin/doom b/bin/doom index 416005e75..3a9907e99 100755 --- a/bin/doom +++ b/bin/doom @@ -7,7 +7,7 @@ :; _DOOMPOST="$_DOOMBASE/.local/.doom.sh" :; $EMACS --no-site-file --script "$0" -- "$@" :; CODE=$? -:; [ -x "$_DOOMPOST" ] && PATH="$_DOOMBASE/bin:$PATH" "$_DOOMPOST" "$0" "$@" +:; [ -x "$_DOOMPOST" ] && "$_DOOMPOST" "$0" "$@" :; exit $CODE ;; CLI ops tend to eat a lot of memory. To speed it up, stave off the GC, but diff --git a/core/core-cli.el b/core/core-cli.el index 6bc74268f..c4dba62c0 100644 --- a/core/core-cli.el +++ b/core/core-cli.el @@ -177,10 +177,11 @@ COMMAND, and passes ARGS to it." (insert "#!/usr/bin/env sh\n" (save-match-data (cl-loop for env in process-environment - if (string-match "^\\([^ !@#$%^&*()=]+\\)=\\(.+\\)$" env) - concat (format "%s=%S\n" + if (string-match "^\\([a-zA-Z0-9_]+\\)=\\(.+\\)$" env) + concat (format "export %s=%S\n" (match-string 1 env) (match-string 2 env)))) + (format "\nexport PATH=\"%s:$PATH\"\n" (concat doom-emacs-dir "bin/")) "\n[ -x \"$0\" ] && rm -f \"$0\"\n" (if (stringp lines) lines