From 499630fdcd445da636450318804c846bedfc1fe9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 24 May 2018 16:00:46 +0200 Subject: [PATCH] bin/doom: handle doc/doctor especially --- bin/doom | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/doom b/bin/doom index 9ce2f8a0b..b2d15728f 100755 --- a/bin/doom +++ b/bin/doom @@ -2,9 +2,10 @@ ":"; command -v emacs >/dev/null || { >&2 echo "Emacs isn't installed"; exit 1; } # -*-emacs-lisp-*- ":"; VERSION=$(emacs --version | head -n1) ":"; [[ $VERSION == *\ 2[0-2].[0-1].[0-9] ]] && { echo "You're running $VERSION"; echo "That version is too old to run Doom. Check your PATH"; echo; exit 2; } -":"; [[ $1 != run ]] && { exec emacs --quick --script "$0" -- $@; exit 0; } -":"; cd $(dirname "${BASH_SOURCE:-${(%):-%x}}")/.. -":"; shift; exec emacs -Q -l bin/doom $@ +":"; DOOMDIR=$(dirname "${BASH_SOURCE:-${(%):-%x}}")/.. +":"; [[ $1 == doc || $1 == doctor ]] && { cd "$DOOMDIR"; exec emacs --script bin/doom-doctor; exit 0; } +":"; [[ $1 == run ]] && { cd "$DOOMDIR"; shift; exec emacs -Q -l bin/doom "$@"; exit 0; } +":"; exec emacs --quick --script "$0" -- $@ ":"; exit 0 (defun usage ()