bin/doom: improve POSIX compliance

+ The bourne shell does not guarantee it'll understand the new $()
  subshell syntax.
+ Can't rely on set -e to short circuit the script. No avoiding the
  roundabout suppression of the postscript error with '&& true'.

Might fix #3844, but doubt it.
This commit is contained in:
Henrik Lissner 2020-08-27 14:34:32 -04:00
parent b6a6f41025
commit e03824bf5e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -3,7 +3,7 @@
:; case "$EMACS" in *term*) EMACS=emacs ;; *) EMACS="${EMACS:-emacs}" ;; esac
:; $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 ] && "$(emacs -Q --batch --eval '(princ temporary-file-directory)')/doom.sh" "$0" "$@"
:; [ "${__DOOMCODE:-0}" -eq 128 ] && { "`$EMACS -Q --batch --eval '(princ temporary-file-directory)'`/doom.sh" "$0" "$@" && true; __DOOMCODE=$?; }
:; exit $__DOOMCODE
;; The garbage collector isn't important during CLI ops. A higher threshold