Fix #5093: git version doctor check on macOS

git version's output is formatted differently on macOS (because of
course it is), so I use a more flexible check.
This commit is contained in:
Henrik Lissner 2021-05-25 10:30:13 -04:00
parent daa50557a4
commit 7b5baf319b

View file

@ -62,12 +62,17 @@ in."
(print-group! (print-group!
(if (not (executable-find "git")) (if (not (executable-find "git"))
(error! "Couldn't find git on your machine! Doom's package manager won't work.") (error! "Couldn't find git on your machine! Doom's package manager won't work.")
(let ((version (cadr (split-string (save-match-data
(cdr (doom-call-process "git" "version")) (let* ((version
" version ")))) (cdr (doom-call-process "git" "version")))
(when (version< version "2.28") (version
(error! "Git %s detected! Doom requires git 2.28 or newer!" (and (string-match "\\_<[0-9]+\\.[0-9]+\\(\\.[0-9]+\\)\\_>" version)
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") (unless (executable-find "rg")
(error! "Couldn't find the `rg' binary; this a hard dependecy for Doom, file searches may not work at all"))) (error! "Couldn't find the `rg' binary; this a hard dependecy for Doom, file searches may not work at all")))