[Fix #1266] Improve Emacs version detection logic in the installer script

The fix is naive -- it'll work fine (printing a warning) if there is no emacs installed, but if emacs *is* installed and just formats the `--version` line differently than the pipeline is expecting, it'll also print the warning -- which isn't *ideal*, but should work in most cases.
This commit is contained in:
Case Duckworth 2020-09-16 01:32:35 -05:00 committed by GitHub
parent a218bfe745
commit 079564cf17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,7 +174,8 @@ else
fi
### Check emacs version
if [ $(emacs --version 2>/dev/null | sed -n 's/.*[^0-9.]\([0-9]*\.[0-9.]*\).*/\1/p;q' | sed 's/\..*//g') -lt 24 ]
emacs_version="$(emacs --version 2>/dev/null | sed -n 's/.*[^0-9.]\([0-9]*\.[0-9.]*\).*/\1/p;q' | sed 's/\..*//g')"
if [ "${emacs_version:-0}" -lt 24 ]
then
printf "$YELLOW WARNING:$RESET Prelude depends on emacs $RED 24$RESET !\n"
fi