bin/doom: allow script to be symlinked #3746
This commit is contained in:
parent
5c6189fb4e
commit
4fa0241134
1 changed files with 4 additions and 3 deletions
7
bin/doom
7
bin/doom
|
@ -2,7 +2,6 @@
|
||||||
:; set -e # -*- mode: emacs-lisp; lexical-binding: t -*-
|
:; set -e # -*- mode: emacs-lisp; lexical-binding: t -*-
|
||||||
:; ( echo "$EMACS" | grep -q "term" ) && EMACS=emacs || EMACS=${EMACS:-emacs}
|
:; ( echo "$EMACS" | grep -q "term" ) && EMACS=emacs || EMACS=${EMACS:-emacs}
|
||||||
:; command -v "$EMACS" >/dev/null || { >&2 echo "Can't find emacs in your PATH"; exit 1; }
|
:; command -v "$EMACS" >/dev/null || { >&2 echo "Can't find emacs in your PATH"; exit 1; }
|
||||||
:; export EMACSDIR="${EMACSDIR:-`dirname "$0"`/..}"
|
|
||||||
:; export __DOOMPOST="${TMPDIR:-/tmp}/doom.sh"
|
:; export __DOOMPOST="${TMPDIR:-/tmp}/doom.sh"
|
||||||
:; __DOOMCODE=0
|
:; __DOOMCODE=0
|
||||||
:; "$EMACS" --no-site-file --script "$0" -- "$@" || __DOOMCODE=$?
|
:; "$EMACS" --no-site-file --script "$0" -- "$@" || __DOOMCODE=$?
|
||||||
|
@ -22,8 +21,10 @@
|
||||||
;; presumably installed. EMACSDIR is set in the shell script preamble earlier in
|
;; presumably installed. EMACSDIR is set in the shell script preamble earlier in
|
||||||
;; this file.
|
;; this file.
|
||||||
(setq user-emacs-directory
|
(setq user-emacs-directory
|
||||||
(file-name-as-directory ; ensure the trailing slash...
|
(if (getenv "EMACSDIR")
|
||||||
(expand-file-name (or (getenv "EMACSDIR") ""))))
|
(file-name-as-directory (expand-file-name (getenv "EMACSDIR")))
|
||||||
|
(expand-file-name
|
||||||
|
"../" (file-name-directory (file-truename load-file-name)))))
|
||||||
|
|
||||||
;; Handle some potential issues early
|
;; Handle some potential issues early
|
||||||
(when (version< emacs-version "26.1")
|
(when (version< emacs-version "26.1")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue