diff --git a/bin/doom b/bin/doom index 6f7588309..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" ] && source "$_DOOMPOST" +:; [ -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 359389050..3d263c4d3 100644 --- a/core/core-cli.el +++ b/core/core-cli.el @@ -175,7 +175,8 @@ COMMAND, and passes ARGS to it." (coding-system-for-read 'utf-8) (delimiter "__EOF__")) (with-temp-file post-script - (insert (save-match-data + (insert "#!/usr/bin/env sh\n" + (save-match-data (cl-loop for env in process-environment if (string-match "^\\([a-zA-Z0-9_]+\\)=\\(.+\\)$" env) concat (format "%s=%s \\\n" diff --git a/modules/config/literate/autoload.el b/modules/config/literate/autoload.el index 7f22c3f7e..dac6f05ef 100644 --- a/modules/config/literate/autoload.el +++ b/modules/config/literate/autoload.el @@ -72,7 +72,7 @@ byte-compiled from.") (with-temp-file cache) (if doom-interactive-p t (message "Restarting..." ) - (doom-cli-execute-lines-after "NOTANGLE=1 \"$0\" \"$@\"") + (doom-cli-execute-lines-after "NOTANGLE=1 \"$@\"") (kill-emacs 0)))))) ;;;###autoload