Fix doom update #1584
It would no-op if you responded "y" to the 'update them?' prompt, and proceed if you responded "n". Doom must be in its rebellious phase. Also relevant: #1585
This commit is contained in:
parent
22404f1ec5
commit
a301330603
1 changed files with 41 additions and 40 deletions
|
@ -166,46 +166,47 @@ a list of packages that will be updated."
|
||||||
(nconc specs (async-get (pop futures))))
|
(nconc specs (async-get (pop futures))))
|
||||||
(terpri)
|
(terpri)
|
||||||
(if-let (specs (delq nil (cdr specs)))
|
(if-let (specs (delq nil (cdr specs)))
|
||||||
(if (or auto-accept-p
|
(if (not
|
||||||
(y-or-n-p
|
(or auto-accept-p
|
||||||
(format! "%s\n\nThere %s %d package%s available to update. Update them?"
|
(y-or-n-p
|
||||||
(mapconcat
|
(format!
|
||||||
(lambda (spec)
|
"%s\n\nThere %s %d package%s available to update. Update them?"
|
||||||
(cl-destructuring-bind (n pretime time recipe) spec
|
(mapconcat
|
||||||
(straight--with-plist recipe (package)
|
(lambda (spec)
|
||||||
(format! "+ %-33s %s commit(s) behind %s -> %s"
|
(cl-destructuring-bind (n pretime time recipe) spec
|
||||||
(yellow package) (yellow n)
|
(straight--with-plist recipe (package)
|
||||||
(format-time-string "%Y%m%d" pretime)
|
(format! "+ %-33s %s commit(s) behind %s -> %s"
|
||||||
(format-time-string "%Y%m%d" time)))))
|
(yellow package) (yellow n)
|
||||||
specs
|
(format-time-string "%Y%m%d" pretime)
|
||||||
"\n")
|
(format-time-string "%Y%m%d" time)))))
|
||||||
(if (cdr specs) "are" "is")
|
specs
|
||||||
(length specs)
|
"\n")
|
||||||
(if (cdr specs) "s" ""))))
|
(if (cdr specs) "are" "is")
|
||||||
(terpri)
|
(length specs)
|
||||||
(dolist (spec specs t)
|
(if (cdr specs) "s" "")))))
|
||||||
(cl-destructuring-bind (n pretime time recipe) spec
|
(ignore (print! (info "Aborted update")))
|
||||||
(straight--with-plist recipe (local-repo package)
|
(terpri)
|
||||||
(let ((default-directory (straight--repos-dir local-repo)))
|
(dolist (spec specs t)
|
||||||
(print! (start "Updating %S") package)
|
(cl-destructuring-bind (n pretime time recipe) spec
|
||||||
;; HACK `straight' doesn't assume it would ever be used
|
(straight--with-plist recipe (local-repo package)
|
||||||
;; non-interactively, but here we are. If the repo is
|
(let ((default-directory (straight--repos-dir local-repo)))
|
||||||
;; dirty, the command will lock up, waiting for
|
(print! (start "Updating %S") package)
|
||||||
;; interaction that will never come, so discard all local
|
;; HACK `straight' doesn't assume it would ever be used
|
||||||
;; changes. Doom doesn't want you modifying those anyway.
|
;; non-interactively, but here we are. If the repo is
|
||||||
(and (straight--get-call "git" "reset" "--hard")
|
;; dirty, the command will lock up, waiting for
|
||||||
(straight--get-call "git" "clean" "-ffd"))
|
;; interaction that will never come, so discard all local
|
||||||
(straight-merge-package package)
|
;; changes. Doom doesn't want you modifying those anyway.
|
||||||
;; HACK `straight-rebuild-package' doesn't pick up that
|
(and (straight--get-call "git" "reset" "--hard")
|
||||||
;; this package has changed, so we do it manually. Is
|
(straight--get-call "git" "clean" "-ffd"))
|
||||||
;; there a better way?
|
(straight-merge-package package)
|
||||||
(run-hook-with-args 'straight-use-package-pre-build-functions package)
|
;; HACK `straight-rebuild-package' doesn't pick up that
|
||||||
(straight--build-package recipe " "))
|
;; this package has changed, so we do it manually. Is
|
||||||
(with-current-buffer (straight--process-get-buffer)
|
;; there a better way?
|
||||||
(with-silent-modifications
|
(run-hook-with-args 'straight-use-package-pre-build-functions package)
|
||||||
(erase-buffer))))))
|
(straight--build-package recipe " "))
|
||||||
(print! (info "Aborted update"))
|
(with-current-buffer (straight--process-get-buffer)
|
||||||
nil)
|
(with-silent-modifications
|
||||||
|
(erase-buffer)))))))
|
||||||
(print! (success "No packages to update"))
|
(print! (success "No packages to update"))
|
||||||
nil)))
|
nil)))
|
||||||
(error
|
(error
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue