fix(cli): #6772 - trivial doomscripts fail

When trying to establish the value of EMACSDIR, the proper fallback
when BASH_SOURCE is undefined is $0 rather than 0, in correct shell-
scripting parlance.
This commit is contained in:
Jeff Kowalski 2022-09-11 21:07:34 -07:00 committed by Henrik Lissner
parent 2548632600
commit 571ab7425a

View file

@ -44,7 +44,7 @@ fi
# Doom respects $EMACSDIR to tell it where Doom lives. If it fails, then this is
# either isn't bash, or it's a posix shell being directly sourced with sh, which
# is unsupported.
export EMACSDIR="${EMACSDIR:-$(CDPATH= cd -- $(dirname -- "${BASH_SOURCE:-0}")/.. && pwd)}"
export EMACSDIR="${EMACSDIR:-$(CDPATH= cd -- $(dirname -- "${BASH_SOURCE:-$0}")/.. && pwd)}"
if [ ! -f "$EMACSDIR/early-init.el" ]; then
>&2 echo "Error: cannot load $EMACSDIR/early-init.el."
>&2 echo