From 8fd15cde3032ac3f283038818fe8b81df1bdfc7f Mon Sep 17 00:00:00 2001 From: Billy Everyteen Date: Sat, 13 Feb 2016 09:36:28 +0100 Subject: [PATCH] Fix compile.sh version checking --- main.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.sh b/main.sh index 2119302335..5cb675fa4c 100644 --- a/main.sh +++ b/main.sh @@ -48,9 +48,9 @@ else fi # compile.sh version checking -ver1=$(grep '^# VERSION' "$SRC/compile.sh" | cut -d'=' -f2) -ver2=$(grep '^# VERSION' "$SRC/lib/compile.sh" | cut -d'=' -f2) -if [ -z "$ver1" ] || [ "$ver1" -lt "$ver2" ]; then +ver1=$(awk -F"=" '/^# VERSION/ {print $2}' <"$SRC/compile.sh") +ver2=$(awk -F"=" '/^# VERSION/ {print $2}' <"$SRC/lib/compile.sh" 2>/dev/null) || ver2=0 +if [ -z "$ver1" ] || [ $ver1 -lt $ver2 ]; then display_alert "File $0 is outdated. Please overwrite is with updated version from" "$SRC/lib" "wrn" read -p "Press to abort compilation, to ignore and continue" fi @@ -323,4 +323,4 @@ fi end=`date +%s` runtime=$(((end-start)/60)) -display_alert "Runtime" "$runtime min" "info" \ No newline at end of file +display_alert "Runtime" "$runtime min" "info"