Fix void-function doom-sh error in 'doom upgrade' #2034

This commit is contained in:
Henrik Lissner 2019-11-09 11:06:06 -05:00
parent cc1bbe0b7e
commit a55b5a4514
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -28,7 +28,7 @@ following shell commands:
(defun doom--working-tree-dirty-p (dir) (defun doom--working-tree-dirty-p (dir)
(cl-destructuring-bind (success . stdout) (cl-destructuring-bind (success . stdout)
(doom-sh "git" "status" "--porcelain" "-uno") (doom-call-process "git" "status" "--porcelain" "-uno")
(if (= 0 success) (if (= 0 success)
(string-match-p "[^ \t\n]" (buffer-string)) (string-match-p "[^ \t\n]" (buffer-string))
(error "Failed to check working tree in %s" dir)))) (error "Failed to check working tree in %s" dir))))
@ -55,15 +55,15 @@ following shell commands:
(format "Refusing to upgrade because %S has been modified." (path doom-emacs-dir)) (format "Refusing to upgrade because %S has been modified." (path doom-emacs-dir))
"Either stash/undo your changes or run 'doom upgrade -f' to discard local changes.") "Either stash/undo your changes or run 'doom upgrade -f' to discard local changes.")
(print! (info "You have local modifications in Doom's source. Discarding them...")) (print! (info "You have local modifications in Doom's source. Discarding them..."))
(doom-sh "git" "reset" "--hard" (format "origin/%s" branch)) (doom-call-process "git" "reset" "--hard" (format "origin/%s" branch))
(doom-sh "git" "clean" "-ffd"))) (doom-call-process "git" "clean" "-ffd")))
(doom-sh "git" "remote" "remove" doom-repo-remote) (doom-call-process "git" "remote" "remove" doom-repo-remote)
(unwind-protect (unwind-protect
(progn (progn
(or (zerop (car (doom-sh "git" "remote" "add" doom-repo-remote doom-repo-url))) (or (zerop (car (doom-call-process "git" "remote" "add" doom-repo-remote doom-repo-url)))
(error "Failed to add %s to remotes" doom-repo-remote)) (error "Failed to add %s to remotes" doom-repo-remote))
(or (zerop (car (doom-sh "git" "fetch" "--tags" doom-repo-remote branch))) (or (zerop (car (doom-call-process "git" "fetch" "--tags" doom-repo-remote branch)))
(error "Failed to fetch from upstream")) (error "Failed to fetch from upstream"))
(let ((this-rev (vc-git--rev-parse "HEAD")) (let ((this-rev (vc-git--rev-parse "HEAD"))
@ -79,9 +79,9 @@ following shell commands:
((print! (info "A new version of Doom Emacs is available!\n\n Old revision: %s (%s)\n New revision: %s (%s)\n" ((print! (info "A new version of Doom Emacs is available!\n\n Old revision: %s (%s)\n New revision: %s (%s)\n"
(substring this-rev 0 10) (substring this-rev 0 10)
(cdr (doom-sh "git" "log" "-1" "--format=%cr" "HEAD")) (cdr (doom-call-process "git" "log" "-1" "--format=%cr" "HEAD"))
(substring new-rev 0 10) (substring new-rev 0 10)
(cdr (doom-sh "git" "log" "-1" "--format=%cr" target-remote)))) (cdr (doom-call-process "git" "log" "-1" "--format=%cr" target-remote))))
(when (and (not auto-accept-p) (when (and (not auto-accept-p)
(y-or-n-p "View the comparison diff in your browser?")) (y-or-n-p "View the comparison diff in your browser?"))
@ -96,7 +96,7 @@ following shell commands:
(print! (start "Upgrading Doom Emacs...")) (print! (start "Upgrading Doom Emacs..."))
(print-group! (print-group!
(doom-clean-byte-compiled-files) (doom-clean-byte-compiled-files)
(unless (and (zerop (car (doom-sh "git" "reset" "--hard" target-remote))) (unless (and (zerop (car (doom-call-process "git" "reset" "--hard" target-remote)))
(equal (vc-git--rev-parse "HEAD") new-rev)) (equal (vc-git--rev-parse "HEAD") new-rev))
(error "Failed to check out %s" (substring new-rev 0 10))) (error "Failed to check out %s" (substring new-rev 0 10)))
(print! (success "Finished upgrading Doom Emacs"))) (print! (success "Finished upgrading Doom Emacs")))
@ -106,4 +106,4 @@ following shell commands:
(print! (success "Done! Restart Emacs for changes to take effect.")))))) (print! (success "Done! Restart Emacs for changes to take effect."))))))
(ignore-errors (ignore-errors
(doom-sh "git" "remote" "remove" doom-repo-remote)))))) (doom-call-process "git" "remote" "remove" doom-repo-remote))))))