Skip to content

Commit

Permalink
Merge pull request #245 from DrDaveD/singularity6378
Browse files Browse the repository at this point in the history
Ignore prelease part of go version
  • Loading branch information
DrDaveD committed Feb 9, 2022
2 parents 7b55e63 + 18a247a commit c9d336e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mlocal/scripts/check-min-go-version
Expand Up @@ -17,6 +17,11 @@ if [ "$GOMINOR" = "$GOPATCH" ]; then
else
GOMINOR="${GOMINOR/.*}"
fi
# ignore GO pre-release extensions
if ! [[ "$GOMINOR" =~ ^[0-9]$ ]]; then
# shellcheck disable=SC2001
GOMINOR="$(echo "$GOMINOR"|sed 's/^\([0-9]*\).*/\1/')"
fi

MINVERSION="$2"
MINMAJOR="${MINVERSION/.*}"
Expand All @@ -28,16 +33,16 @@ else
MINMINOR="${MINMINOR/.*}"
fi

if [ $GOMAJOR -lt $MINMAJOR ]; then
if [ "$GOMAJOR" -lt "$MINMAJOR" ]; then
exit 1
fi
if [ $GOMAJOR -gt $MINMAJOR ]; then
if [ "$GOMAJOR" -gt "$MINMAJOR" ]; then
exit 0
fi
if [ $GOMINOR -lt $MINMINOR ]; then
if [ "$GOMINOR" -lt "$MINMINOR" ]; then
exit 1
fi
if [ $GOMINOR -gt $MINMINOR ]; then
if [ "$GOMINOR" -gt "$MINMINOR" ]; then
exit 0
fi
if [ -z "$MINPATCH" ]; then
Expand All @@ -46,7 +51,7 @@ fi
if [ -z "$GOPATCH" ]; then
exit 1
fi
if [ $GOPATCH -lt $MINPATCH ]; then
if [ "$GOPATCH" -lt "$MINPATCH" ]; then
exit 1
fi
exit 0

0 comments on commit c9d336e

Please sign in to comment.