Skip to content

Instantly share code, notes, and snippets.

@swilly22
Created July 21, 2020 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swilly22/7822ccef96dfe04b873b4da776a34653 to your computer and use it in GitHub Desktop.
Save swilly22/7822ccef96dfe04b873b4da776a34653 to your computer and use it in GitHub Desktop.
bump version
#!/bin/bash
VERSION_H=./src/version.h
MAJOR=99
MINOR=99
PATCH=99
DRYRUN=echo
read -r -p "dryrun? [Y/n]" input
if [ "$input" == "n" ]; then
unset DRYRUN
fi
echo version major
read MAJOR
echo version minor
read MINOR
echo version patch
read PATCH
$DRYRUN sed -i '' "s/#define REDISGRAPH_VERSION_MAJOR.*/#define REDISGRAPH_VERSION_MAJOR $MAJOR/g" $VERSION_H
$DRYRUN sed -i '' "s/#define REDISGRAPH_VERSION_MINOR.*/#define REDISGRAPH_VERSION_MINOR $MINOR/g" $VERSION_H
$DRYRUN sed -i '' "s/#define REDISGRAPH_VERSION_PATCH.*/#define REDISGRAPH_VERSION_PATCH $PATCH/g" $VERSION_H
echo creating bump version commit
$DRYRUN git add ./src/version.h
$DRYRUN git commit -m "Version bump"
echo tag version
$DRYRUN git tag "v$MAJOR.$MINOR.$PATCH"
echo push branch
$DRYRUN git push
echo push tag
$DRYRUN git push --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment