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!
(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 "))))
(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))))
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")))