Skip to content

Instantly share code, notes, and snippets.

View kotwanikunal's full-sized avatar
🚀

Kunal Kotwani kotwanikunal

🚀
View GitHub Profile
@kotwanikunal
kotwanikunal / version.sh
Created July 26, 2023 17:06
Version Test
TAG="2.9.0"
CURRENT_VERSION_ARRAY=($(echo "$TAG" | tr . '\n'))
BASE=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:2}")
BASE_X=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:1}.x")
CURRENT_VERSION=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:3}")
CURRENT_VERSION_UNDERSCORE=$(IFS=_ ; echo "V_${CURRENT_VERSION_ARRAY[*]:0:3}")
CURRENT_VERSION_ARRAY[2]=$((CURRENT_VERSION_ARRAY[2]+1))
NEXT_VERSION=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:3}")
NEXT_VERSION_UNDERSCORE=$(IFS=_ ; echo "V_${CURRENT_VERSION_ARRAY[*]:0:3}")