Skip to content

Commit

Permalink
Fix doomemacs#5093: git version doctor check on macOS
Browse files Browse the repository at this point in the history
git version's output is formatted differently on macOS (because of
course it is), so I use a more flexible check.
  • Loading branch information
hlissner committed May 25, 2021
1 parent daa5055 commit 7b5baf3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions core/cli/doctor.el
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,17 @@ in."
(print-group!
(if (not (executable-find "git"))
(error! "Couldn't find git on your machine! Doom's package manager won't work.")
(let ((version (cadr (split-string
(cdr (doom-call-process "git" "version"))
" version "))))
(when (version< version "2.28")
(error! "Git %s detected! Doom requires git 2.28 or newer!"
version))))
(save-match-data
(let* ((version
(cdr (doom-call-process "git" "version")))
(version
(and (string-match "\\_<[0-9]+\\.[0-9]+\\(\\.[0-9]+\\)\\_>" version)
(match-string 0 version))))
(if version
(when (version< version "2.28")
(error! "Git %s detected! Doom requires git 2.28 or newer!"
version))
(warn! "Cannot determine Git version. Doom requires git 2.28 or newer!")))))

(unless (executable-find "rg")
(error! "Couldn't find the `rg' binary; this a hard dependecy for Doom, file searches may not work at all")))
Expand Down

0 comments on commit 7b5baf3

Please sign in to comment.