Browse Source

Improved versioncheck script to account for equal versions

Horea Christian 11 months ago
parent
commit
c84fc57bf0
1 changed files with 7 additions and 2 deletions
  1. 7 2
      code/versioncheck.sh

+ 7 - 2
code/versioncheck.sh

@@ -2,12 +2,17 @@
 
 RDIR="releases/"
 
+VERSION=${1}
+
 LAST_VER_PATH=$(ls ${RDIR}mouse-brain-templates-*.tar.xz | sort -V | tail -n1)
 LAST_VER=$(echo ${LAST_VER_PATH} | sed "s:${RDIR}mouse-brain-templates-::" | sed "s:\.tar\.xz::")
 
-LATEST=$(echo -e "${1}\n${LAST_VER}" | sort -V | tail -n1)
+LATEST=$(echo -e "${VERSION}\n${LAST_VER}" | sort -V | tail -n1)
 
-if [ "${LATEST}" != "${1}" ]; then
+if [ "${LATEST}" != "${VERSION}" ]; then
 	echo "The selected version (\`${VERSION}\`) appears to be lower than that of the highest release archive (\`${LAST_VER_PATH}\`)."
 	exit 1
+elif [ "${LATEST}" == "${LAST_VER}" ]; then
+	echo "The selected version (\`${VERSION}\`) appears to be identical to the highest release archive (\`${LAST_VER_PATH}\`)."
+	exit 1
 fi