Fix 'doom run' #1724
This commit is contained in:
parent
f90cf1f974
commit
081f09aac8
1 changed files with 38 additions and 36 deletions
74
bin/doom
74
bin/doom
|
@ -81,40 +81,42 @@
|
||||||
(error "%s does not exist" user-emacs-directory))
|
(error "%s does not exist" user-emacs-directory))
|
||||||
|
|
||||||
;; Bootstrap Doom
|
;; Bootstrap Doom
|
||||||
(load (expand-file-name "core/core.el" user-emacs-directory)
|
(if (not noninteractive)
|
||||||
nil 'nomessage)
|
(progn
|
||||||
|
(load (expand-file-name "init.el" user-emacs-directory)
|
||||||
|
nil 'nomessage)
|
||||||
|
(doom-run-all-startup-hooks-h))
|
||||||
|
(load (expand-file-name "core/core.el" user-emacs-directory)
|
||||||
|
nil 'nomessage)
|
||||||
|
(doom-initialize 'force-p)
|
||||||
|
(doom-initialize-modules)
|
||||||
|
|
||||||
(doom-initialize 'force-p)
|
(cond ((and (not (cdr args))
|
||||||
(doom-initialize-modules)
|
(member (car args) '("help" "h")))
|
||||||
|
(usage))
|
||||||
(cond ((not noninteractive)
|
((not args)
|
||||||
(doom-run-all-startup-hooks-h))
|
(print! (error "No command detected.\n"))
|
||||||
((and (not (cdr args))
|
(usage))
|
||||||
(member (car args) '("help" "h")))
|
((require 'core-cli)
|
||||||
(usage))
|
(let ((default-directory user-emacs-directory))
|
||||||
((not args)
|
(setq argv nil)
|
||||||
(print! (error "No command detected.\n"))
|
(condition-case e
|
||||||
(usage))
|
(doom-dispatch (car args) (cdr args))
|
||||||
((require 'core-cli)
|
(user-error
|
||||||
(let ((default-directory user-emacs-directory))
|
(print! (error "%s\n") (error-message-string e))
|
||||||
(setq argv nil)
|
(print! (yellow "See 'doom help %s' for documentation on this command.") (car args)))
|
||||||
(condition-case e
|
((debug error)
|
||||||
(doom-dispatch (car args) (cdr args))
|
(message "--------------------------------------------------\n")
|
||||||
(user-error
|
(message "There was an unexpected error:")
|
||||||
(print! (error "%s\n") (error-message-string e))
|
(message " %s (%s)" (get (car e) 'error-message) (car e))
|
||||||
(print! (yellow "See 'doom help %s' for documentation on this command.") (car args)))
|
(dolist (item (cdr e))
|
||||||
((debug error)
|
(message " %s" item))
|
||||||
(message "--------------------------------------------------\n")
|
(unless debug-on-error
|
||||||
(message "There was an unexpected error:")
|
(message
|
||||||
(message " %s (%s)" (get (car e) 'error-message) (car e))
|
(concat "\nRun the command again with the -d (or --debug) option to enable debug\n"
|
||||||
(dolist (item (cdr e))
|
"mode and, hopefully, generate a stack trace. If you decide to file a bug\n"
|
||||||
(message " %s" item))
|
"report, please include it!\n\n"
|
||||||
(unless debug-on-error
|
"Emacs outputs to standard error, so you'll need to redirect stderr to\n"
|
||||||
(message
|
"stdout to pipe this to a file or clipboard!\n\n"
|
||||||
(concat "\nRun the command again with the -d (or --debug) option to enable debug\n"
|
" e.g. doom -d install 2>&1 | clipboard-program"))
|
||||||
"mode and, hopefully, generate a stack trace. If you decide to file a bug\n"
|
(signal 'doom-error e)))))))))
|
||||||
"report, please include it!\n\n"
|
|
||||||
"Emacs outputs to standard error, so you'll need to redirect stderr to\n"
|
|
||||||
"stdout to pipe this to a file or clipboard!\n\n"
|
|
||||||
" e.g. doom -d install 2>&1 | clipboard-program"))
|
|
||||||
(signal 'doom-error e))))))))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue