From 571ab7425a2c0158deedaab56b7665a854fc4325 Mon Sep 17 00:00:00 2001 From: Jeff Kowalski Date: Sun, 11 Sep 2022 21:07:34 -0700 Subject: [PATCH] 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. --- bin/doomscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/doomscript b/bin/doomscript index 203ed0552..1c16caf37 100755 --- a/bin/doomscript +++ b/bin/doomscript @@ -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