mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 02:30:33 -08:00
feat(doom-cli): shows diff in terminal
if gh is found
This commit is contained in:
parent
ca7e226e13
commit
117cc5702c
1 changed files with 12 additions and 5 deletions
|
|
@ -134,11 +134,18 @@ libraries. It is the equivalent of the following shell commands:
|
||||||
this-rev
|
this-rev
|
||||||
new-rev)))
|
new-rev)))
|
||||||
(print! "Link to diff: %s" diff-url)
|
(print! "Link to diff: %s" diff-url)
|
||||||
(when (and (not auto-accept-p)
|
(if-let* ((gh (executable-find "gh"))
|
||||||
(y-or-n-p "View the comparison diff in your browser?"))
|
(cmd (format "%s api repos/doomemacs/doomemacs/compare/%s...%s"
|
||||||
(print! (item "Opened github in your browser."))
|
gh this-rev new-rev)))
|
||||||
(browse-url diff-url)))
|
(progn
|
||||||
|
(when-let* ((delta (executable-find "delta")))
|
||||||
|
(setq cmd (format "%s | %s --paging=never" cmd delta)))
|
||||||
|
(print! "Comparison diff: %s" diff-url)
|
||||||
|
(sh! cmd))
|
||||||
|
(when (and (not auto-accept-p)
|
||||||
|
(y-or-n-p "View the comparison diff in your browser?"))
|
||||||
|
(print! (item "Opened github in your browser."))
|
||||||
|
(browse-url diff-url))))
|
||||||
(if (not (or auto-accept-p
|
(if (not (or auto-accept-p
|
||||||
(y-or-n-p "Proceed with upgrade?")))
|
(y-or-n-p "Proceed with upgrade?")))
|
||||||
(ignore (print! (error "Aborted")))
|
(ignore (print! (error "Aborted")))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue