fix(cli): increment __DOOMSTEP in elisp instead
Some shells (like ksh on SDF) may complain about $((...)) arithmetic expansion syntax. Rather than wrestle with old shells, I'll offload this trivial operation to elisp instead. Close: #6970
This commit is contained in:
parent
d883863b91
commit
0ecf69afaf
3 changed files with 3 additions and 2 deletions
2
bin/doom
2
bin/doom
|
@ -5,7 +5,7 @@
|
||||||
:; tmpdir=`$emacs --eval '(princ (temporary-file-directory))' 2>/dev/null`
|
:; tmpdir=`$emacs --eval '(princ (temporary-file-directory))' 2>/dev/null`
|
||||||
:; [ -z "$tmpdir" ] && { >&2 echo "Error: failed to run Emacs with command '$EMACS'"; >&2 echo; >&2 echo "Are you sure Emacs is installed and in your \$PATH?"; exit 1; }
|
:; [ -z "$tmpdir" ] && { >&2 echo "Error: failed to run Emacs with command '$EMACS'"; >&2 echo; >&2 echo "Are you sure Emacs is installed and in your \$PATH?"; exit 1; }
|
||||||
:; export __DOOMPID="${__DOOMPID:-$$}"
|
:; export __DOOMPID="${__DOOMPID:-$$}"
|
||||||
:; export __DOOMSTEP="$((__DOOMSTEP+1))"
|
:; export __DOOMSTEP="${__DOOMSTEP:-0}"
|
||||||
:; export __DOOMGEOM="${__DOOMGEOM:-`tput cols 2>/dev/null`x`tput lines 2>/dev/null`}"
|
:; export __DOOMGEOM="${__DOOMGEOM:-`tput cols 2>/dev/null`x`tput lines 2>/dev/null`}"
|
||||||
:; export __DOOMGPIPE=${__DOOMGPIPE:-$__DOOMPIPE}
|
:; export __DOOMGPIPE=${__DOOMGPIPE:-$__DOOMPIPE}
|
||||||
:; export __DOOMPIPE=; [ -t 0 ] || __DOOMPIPE="${__DOOMPIPE}0"; [ -t 1 ] || __DOOMPIPE="${__DOOMPIPE}1"
|
:; export __DOOMPIPE=; [ -t 0 ] || __DOOMPIPE="${__DOOMPIPE}0"; [ -t 1 ] || __DOOMPIPE="${__DOOMPIPE}1"
|
||||||
|
|
|
@ -57,7 +57,7 @@ fi
|
||||||
# Some state that Doom's CLI framework needs to know about the terminal. Read
|
# Some state that Doom's CLI framework needs to know about the terminal. Read
|
||||||
# the comments at the top of bin/doom for explanations.
|
# the comments at the top of bin/doom for explanations.
|
||||||
export __DOOMPID="${__DOOMPID:-$$}"
|
export __DOOMPID="${__DOOMPID:-$$}"
|
||||||
export __DOOMSTEP="$((__DOOMSTEP+1))"
|
export __DOOMSTEP="${__DOOMSTEP:-0}"
|
||||||
export __DOOMGEOM="${__DOOMGEOM:-$(tput cols 2>/dev/null)x$(tput lines 2>/dev/null)}"
|
export __DOOMGEOM="${__DOOMGEOM:-$(tput cols 2>/dev/null)x$(tput lines 2>/dev/null)}"
|
||||||
export __DOOMGPIPE="${__DOOMGPIPE:-$__DOOMPIPE}"
|
export __DOOMGPIPE="${__DOOMGPIPE:-$__DOOMPIPE}"
|
||||||
export __DOOMPIPE=
|
export __DOOMPIPE=
|
||||||
|
|
|
@ -1233,6 +1233,7 @@ Emacs' batch library lacks an implementation of the exec system call."
|
||||||
("EMACSDIR" . ,doom-emacs-dir)
|
("EMACSDIR" . ,doom-emacs-dir)
|
||||||
("DOOMDIR" . ,doom-user-dir)
|
("DOOMDIR" . ,doom-user-dir)
|
||||||
("DEBUG" . ,(if init-file-debug "1"))
|
("DEBUG" . ,(if init-file-debug "1"))
|
||||||
|
("__DOOMSTEP" . ,(doom-cli-context-step context))
|
||||||
("__DOOMCONTEXT" . ,context-file))
|
("__DOOMCONTEXT" . ,context-file))
|
||||||
if val
|
if val
|
||||||
concat (format "%s=%s \\\n" envvar (shell-quote-argument val)))
|
concat (format "%s=%s \\\n" envvar (shell-quote-argument val)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue