Add --discard switch to 'doom upgrade' #2224

Also rewrites straight prompt-in-batch-Emacs hack, and move it to
core-cli.el.
This commit is contained in:
Henrik Lissner 2020-01-09 03:31:05 -05:00
parent 15f2245b10
commit f6852a2c9f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 118 additions and 95 deletions

View file

@ -1,7 +1,8 @@
;; -*- no-byte-compile: t; -*-
;;; core/cli/packages.el
(defcli! (update u) ()
(defcli! (update u)
((discard-p ["--discard"] "All local changes to packages are discarded"))
"Updates packages.
This works by fetching all installed package repos and checking the distance
@ -10,10 +11,11 @@ between HEAD and FETCH_HEAD. This can take a while.
This excludes packages whose `package!' declaration contains a non-nil :freeze
or :ignore property."
(straight-check-all)
(doom-cli-reload-core-autoloads)
(when (doom-cli-packages-update)
(doom-cli-reload-package-autoloads))
t)
(let ((doom-auto-discard discard-p))
(doom-cli-reload-core-autoloads)
(when (doom-cli-packages-update)
(doom-cli-reload-package-autoloads))
t))
(defcli! (build b)
((rebuild-p ["-r"] "Only rebuild packages that need rebuilding"))