Generalize doom-sh
And slightly reformat 'doom upgrade' "you have updates" message.
This commit is contained in:
parent
c67c503392
commit
c32244ad4e
2 changed files with 24 additions and 21 deletions
|
@ -31,6 +31,18 @@ commands like `doom-packages-install', `doom-packages-update' and
|
|||
(eval (sexp-at-point) t))
|
||||
t)))
|
||||
|
||||
(defun doom-sh (command &rest args)
|
||||
"Execute COMMAND with ARGS in the shell and return (STATUS . OUTPUT).
|
||||
|
||||
STATUS is a boolean"
|
||||
(let ((output (get-buffer-create "*doom-sh-output*")))
|
||||
(unwind-protect
|
||||
(cons (or (apply #'call-process command nil output nil args)
|
||||
-1)
|
||||
(with-current-buffer output
|
||||
(string-trim (buffer-string))))
|
||||
(kill-buffer output))))
|
||||
|
||||
(defun doom--dispatch-command (command)
|
||||
(when (symbolp command)
|
||||
(setq command (symbol-name command)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue