From 079564cf1774164cf9e1bfffe67de630b71f3e11 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 16 Sep 2020 01:32:35 -0500 Subject: [PATCH] [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. --- utils/installer.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/installer.sh b/utils/installer.sh index 1717427..177042f 100755 --- a/utils/installer.sh +++ b/utils/installer.sh @@ -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