You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ublexec/devel/update-version

18 lines
688 B

#!/bin/bash
##
## Update VERSION 1.4
## $1 - Version
## Default - current Version value plus one (in minor section)
##
FILE_VERSION="VERSION.md"
[[ $1 ]] && VER=$1
if [[ -z ${VER} ]] ; then
SOURCE_FILE_VERSION=$(find ../ -maxdepth 1 -type f -iname "${FILE_VERSION}" -print -quit)
CURRENT=$(cat ${SOURCE_FILE_VERSION} | grep 'VERSION' | cut -d" " -f2)
MAJOR=$(echo ${CURRENT} | cut -d. -f1)
MINOR=$(echo ${CURRENT} | cut -d. -f2)
VER="${MAJOR}.$(echo $((${MINOR} +1)))"
fi
echo ":: Updated VERSION ${CURRENT} to ${VER}"
find ../ -maxdepth 2 -type f -iname "${FILE_VERSION}" -exec echo ":: Insert version in file: {}" \; -exec sed "s/VERSION *[[:digit:]]*.*/VERSION ${VER}/" -i {} \;