Fix #3844: bin/doom emits wrong-type-arg error on windows

For some reason __DOOMPOST isn't being exported into emacs' environment
on Windows (powershell and git bash).
This commit is contained in:
Henrik Lissner 2020-08-27 00:58:03 -04:00
parent a6dc9bf7e5
commit a2a5038b97
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -1,10 +1,9 @@
#!/usr/bin/env sh
:; set -e # -*- mode: emacs-lisp; lexical-binding: t -*-
:; case "$EMACS" in *term*) EMACS=emacs ;; *) EMACS="${EMACS:-emacs}" ;; esac
:; export __DOOMPOST="${TMPDIR:-/tmp}/doom.sh"
:; $EMACS --version >/dev/null 2>&1 || { >&2 echo "Can't find emacs in your PATH"; exit 1; }
:; $EMACS --no-site-file --script "$0" -- "$@" || __DOOMCODE=$?
:; [ "${__DOOMCODE:-0}" -eq 128 ] && { "$__DOOMPOST" "$0" "$@" && true; __DOOMCODE=$?; }
:; [ "${__DOOMCODE:-0}" -eq 128 ] && "$(emacs -Q --batch --eval '(princ temporary-file-directory)')/doom.sh" "$0" "$@"
:; exit $__DOOMCODE
;; The garbage collector isn't important during CLI ops. A higher threshold
@ -94,7 +93,7 @@
(pred stringp)
(pred keywordp))
command)
(let ((script (getenv "__DOOMPOST"))
(let ((script (expand-file-name "doom.sh" temporary-file-directory))
(coding-system-for-write 'utf-8-unix)
(coding-system-for-read 'utf-8-unix))
(with-temp-file script