Refactor bin/doctor

This commit is contained in:
Henrik Lissner 2017-05-23 22:53:55 +02:00
parent d949935628
commit f2c2550549

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
":"; 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; } # -*-emacs-lisp-*-
":"; [[ $(emacs --version | head -n1) == *\ 2[0-2].[0-1].[0-9] ]] && { echo "You're running $(emacs --version | head -n1)"; echo "That version is too old to run the doctor. Check your PATH"; echo; exit 2; } || exec emacs --no-site-file --batch -l "$0" # -*-emacs-lisp-*- ":"; [[ $(emacs --version | head -n1) == *\ 2[0-2].[0-1].[0-9] ]] && { echo "You're running $(emacs --version | head -n1)"; echo "That version is too old to run the doctor. Check your PATH"; echo; exit 2; } || exec emacs --no-site-file --batch -l "$0"
;; Uses a couple simple heuristics to locate issues with your environment that ;; Uses a couple simple heuristics to locate issues with your environment that
;; could interfere with running or setting up DOOM Emacs. ;; could interfere with running or setting up DOOM Emacs.
@ -13,6 +13,8 @@
(expand-file-name "~/.emacs.d/")) (expand-file-name "~/.emacs.d/"))
(error "Couldn't find ~/.emacs.d")) (error "Couldn't find ~/.emacs.d"))
(require 'pp)
;; ;;
(defvar doom-errors 0) (defvar doom-errors 0)
(defmacro check! (cond &rest body) (defmacro check! (cond &rest body)