bin/doom POSIX compliance
This commit is contained in:
parent
32e266cfb4
commit
902f734cfb
1 changed files with 8 additions and 8 deletions
16
bin/doom
16
bin/doom
|
@ -1,13 +1,13 @@
|
||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
":"; [[ $EMACS = *"term"* ]] && EMACS=emacs || EMACS=${EMACS:-emacs} # -*-emacs-lisp-*-
|
":"; ( echo "$EMACS" | grep -q "term" ) && EMACS=emacs || EMACS=${EMACS:-emacs} # -*-emacs-lisp-*-
|
||||||
":"; command -v $EMACS >/dev/null || { >&2 echo "Emacs isn't installed"; exit 1; }
|
":"; command -v $EMACS >/dev/null || { >&2 echo "Emacs isn't installed"; exit 1; }
|
||||||
":"; VERSION=$($EMACS --version | head -n1)
|
":"; 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; }
|
":"; case "$VERSION" in *\ 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 ;; esac
|
||||||
":"; DOOMBASE=$(dirname "${BASH_SOURCE:-${(%):-%x}}")/..
|
":"; DOOMBASE=$(dirname "$0")/..
|
||||||
":"; [[ $1 == -d || $1 == --debug ]] && { shift; export DEBUG=1; }
|
":"; [ "$1" = -d ] || [ "$1" = --debug ] && { shift; export DEBUG=1; }
|
||||||
":"; [[ $1 == doc || $1 == doctor ]] && { cd "$DOOMBASE"; shift; exec $EMACS --script bin/doom-doctor "$@"; exit 0; }
|
":"; [ "$1" = doc ] || [ "$1" = doctor ] && { cd "$DOOMBASE"; shift; exec $EMACS --script bin/doom-doctor "$@"; exit 0; }
|
||||||
":"; [[ $1 == run ]] && { cd "$DOOMBASE"; shift; exec $EMACS -q --no-splash -l bin/doom "$@"; exit 0; }
|
":"; [ "$1" = run ] && { cd "$DOOMBASE"; shift; exec $EMACS -q --no-splash -l bin/doom "$@"; exit 0; }
|
||||||
":"; exec $EMACS --script "$0" -- $@
|
":"; exec $EMACS --script "$0" -- "$@"
|
||||||
":"; exit 0
|
":"; exit 0
|
||||||
|
|
||||||
(defun usage ()
|
(defun usage ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue