2018-09-27 23:05:04 -04:00
|
|
|
;;; core/autoload/cli.el -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
(require 'core-cli)
|
|
|
|
|
2019-04-26 22:11:37 -04:00
|
|
|
;;;###autoload
|
|
|
|
(defun doom-cli-run (command &rest _args)
|
2019-05-12 01:43:06 -04:00
|
|
|
(when (featurep 'general)
|
|
|
|
(general-auto-unbind-keys))
|
|
|
|
(let* ((evil-collection-mode-list nil)
|
|
|
|
(default-directory doom-emacs-dir)
|
2019-03-09 03:53:38 -05:00
|
|
|
(buf (get-buffer-create " *bin/doom*"))
|
2019-04-26 22:11:37 -04:00
|
|
|
(doom-message-backend 'ansi)
|
2019-03-09 03:53:38 -05:00
|
|
|
(ignore-window-parameters t)
|
2019-03-09 04:28:25 -05:00
|
|
|
(noninteractive t)
|
2019-03-09 03:53:38 -05:00
|
|
|
(standard-output
|
|
|
|
(lambda (char)
|
|
|
|
(with-current-buffer buf
|
|
|
|
(insert char)
|
|
|
|
(when (memq char '(?\n ?\r))
|
|
|
|
(ansi-color-apply-on-region (line-beginning-position -1) (line-end-position))
|
|
|
|
(redisplay))))))
|
2019-03-09 04:28:25 -05:00
|
|
|
(doom-initialize t)
|
|
|
|
(setq doom-modules (doom-modules))
|
|
|
|
(doom-initialize-modules t)
|
|
|
|
(doom-initialize-packages t)
|
|
|
|
(with-current-buffer (switch-to-buffer buf)
|
|
|
|
(erase-buffer)
|
|
|
|
(require 'package)
|
|
|
|
(redisplay)
|
|
|
|
(doom-dispatch command nil)
|
|
|
|
(print! (green "\nDone!"))))
|
2019-05-12 01:43:06 -04:00
|
|
|
(when (featurep 'general)
|
|
|
|
(general-auto-unbind-keys 'undo))
|
2019-03-09 04:28:25 -05:00
|
|
|
(message (format! (green "Done!"))))
|
2018-09-27 23:05:04 -04:00
|
|
|
|
|
|
|
|
2019-03-09 03:53:38 -05:00
|
|
|
;;;###autoload
|
|
|
|
(defun doom//autoloads (&optional yes)
|
|
|
|
"TODO"
|
|
|
|
(interactive "P")
|
2019-04-26 22:11:37 -04:00
|
|
|
(let ((doom-auto-accept yes))
|
|
|
|
(doom-cli-run "autoloads")))
|
2019-03-09 03:53:38 -05:00
|
|
|
|
2018-09-27 23:05:04 -04:00
|
|
|
;;;###autoload
|
2019-05-02 16:20:40 -04:00
|
|
|
(defun doom//update (&optional yes)
|
2018-09-27 23:05:04 -04:00
|
|
|
"TODO"
|
|
|
|
(interactive "P")
|
2019-04-26 22:11:37 -04:00
|
|
|
(let ((doom-auto-accept yes))
|
|
|
|
(doom-cli-run "update")))
|
2018-09-27 23:05:04 -04:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun doom//upgrade (&optional yes)
|
|
|
|
"TODO"
|
|
|
|
(interactive "P")
|
2019-04-26 22:11:37 -04:00
|
|
|
(let ((doom-auto-accept yes))
|
|
|
|
(doom-cli-run "upgrade"))
|
2019-03-22 14:13:35 -04:00
|
|
|
(when (y-or-n-p "You must restart Emacs for the upgrade to take effect. Restart?")
|
|
|
|
(doom/restart-and-restore)))
|
2018-09-27 23:05:04 -04:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun doom//install (&optional yes)
|
|
|
|
"TODO"
|
|
|
|
(interactive "P")
|
2019-04-26 22:11:37 -04:00
|
|
|
(let ((doom-auto-accept yes))
|
|
|
|
(doom-cli-run "install")))
|
2018-09-27 23:05:04 -04:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun doom//autoremove (&optional yes)
|
|
|
|
"TODO"
|
|
|
|
(interactive "P")
|
2019-04-26 22:11:37 -04:00
|
|
|
(let ((doom-auto-accept yes))
|
|
|
|
(doom-cli-run "autoremove")))
|
2018-09-27 23:05:04 -04:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun doom//refresh (&optional yes)
|
|
|
|
"TODO"
|
|
|
|
(interactive "P")
|
2019-04-26 22:11:37 -04:00
|
|
|
(let ((doom-auto-accept yes))
|
|
|
|
(doom-cli-run "refresh")))
|