Do not use shell commands to extract version number

Avoid using 'head', 'sed' or other POSIX commands to extract the version number when Emacs can do it. This allows installing just 'mu', without the extra unix tools in a Windows environment.
This commit is contained in:
Juan Jose Garcia-Ripoll
2020-12-04 16:45:09 +01:00
parent 4eed85187f
commit 03d5640cee

View File

@ -243,9 +243,9 @@ backslashes and double-quotes."
"Cannot find mu, please set `mu4e-mu-binary' to the mu executable path")) "Cannot find mu, please set `mu4e-mu-binary' to the mu executable path"))
;; sanity-check 2 ;; sanity-check 2
(let ((version (shell-command-to-string (let ((version (let ((s (shell-command-to-string (concat mu4e-mu-binary " --version"))))
(format "%s --version | head -1 | sed 's/.*version //' | tr -d '\n'" (and (string-match "version \\([.0-9]+\\)" s)
mu4e-mu-binary)))) (match-string 1 s)))))
(unless (string= version mu4e-mu-version) (unless (string= version mu4e-mu-version)
(mu4e-error (mu4e-error
(concat (concat