Skip to content

Commit

Permalink
Version bump to
Browse files Browse the repository at this point in the history
  • Loading branch information
fadado committed Apr 17, 2017
1 parent be85977 commit 81f03e7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version :
- Version bump to
- Created jqt.make
- Migrated generation to jq
- Implementing external jq
Expand Down
2 changes: 1 addition & 1 deletion bin/jqt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# jqt - jq based web template engine

declare -r VERSION='''0.5.0''0.4.0'
declare -r VERSION='''''0.5.0''0.4.0'
declare -r DATADIR='/usr/local/share'

declare -r SELF=${0##*/}
Expand Down
30 changes: 15 additions & 15 deletions bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,34 @@ PUSH=${1:-No}

if [[ -f VERSION ]]; then
declare -r CURRENT_VERSION=$(<VERSION)
echo 1>&2 "Current version : $CURRENT_VERSION"
echo 1>&2 "Current version : ${CURRENT_VERSION}"
set -- ${CURRENT_VERSION//./ }
declare -i V_MAJOR=$1 V_MINOR=$2 V_PATCH=$3
V_MINOR+=1
V_PATCH=0
declare -r SUGGESTED_VERSION="$V_MAJOR.$V_MINOR.$V_PATCH"
read 1>&2 -p "Enter a version number [$SUGGESTED_VERSION]: "
[[ -z $REPLY ]] && NEXT_VERSION=$SUGGESTED_VERSION
echo 1>&2 "Will set new version to be $NEXT_VERSION"
echo -n $NEXT_VERSION > VERSION
{ echo "Version $NEXT_VERSION:"
git log --pretty=format:" - %s" "v$CURRENT_VERSION"...HEAD
declare -r SUGGESTED_VERSION="${V_MAJOR}.${V_MINOR}.${V_PATCH}"
read 1>&2 -p "Enter a version number [${SUGGESTED_VERSION}]: "
[[ -z $REPLY ]] && NEXT_VERSION=${SUGGESTED_VERSION}
echo 1>&2 "Will set new version to be ${NEXT_VERSION}"
echo -n ${NEXT_VERSION} > VERSION
{ echo "Version ${NEXT_VERSION}:"
git log --pretty=format:" - %s" "v${CURRENT_VERSION}"...HEAD
echo -e '\n'
cat CHANGES
} > /tmp/$$-changes
cp /tmp/$$-changes CHANGES
rm /tmp/$$-changes
git add CHANGES VERSION
sed -i "s/^declare -r VERSION=/&'$NEXT_VERSION'/" bin/jqt
sed -i "s/\[version .*\]/[version $(NEXT_VERSION)]/" bin/jqt
sed -i "s/^Version *:=.*/Version := $(NEXT_VERSION)/" docs/Makefile
git commit -am "Version bump to $NEXT_VERSION"
git tag -a -m "Tagging version $NEXT_VERSION" "v$NEXT_VERSION"
sed -i "s/^declare -r VERSION=/&'${NEXT_VERSION}'/" bin/jqt
sed -i "s/\[version .*\]/[version ${NEXT_VERSION}]/" bin/jqt
sed -i "s/^Version *:=.*/Version := ${NEXT_VERSION}/" docs/Makefile
git commit -am "Version bump to ${NEXT_VERSION}"
git tag -a -m "Tagging version ${NEXT_VERSION}" "v${NEXT_VERSION}"
[[ $PUSH == yes ]] && git push origin --tags
else
echo 1>&2 'Could not find a VERSION file'
read 1>&2 -p 'Create a new VERSION file [y/yes]? '
case $REPLY in
case ${REPLY} in
''|[Yy]|[Yy][Ee][Ss])
echo -n '0.1.0' > VERSION
{ echo 'Version 0.1.0'
Expand All @@ -54,7 +54,7 @@ else
git add VERSION CHANGES
git commit -m 'Added VERSION and CHANGES files, version bump to v0.1.0'
git tag -a -m 'Tagging version 0.1.0' 'v0.1.0'
[[ $PUSH == yes ]] && git push origin --tags
[[ ${PUSH} == yes ]] && git push origin --tags
;;
*) echo 1>&2 'Ok'
;;
Expand Down

0 comments on commit 81f03e7

Please sign in to comment.