Skip to content

Commit

Permalink
Improve version.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
rina23q committed Apr 1, 2020
1 parent 26c5b50 commit 4d13142
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
USAGE="Description: libsera release number versioner.
Usage:
$(basename $0) -h -- Show this help.
$(basename $0) ask -- Show ntcagent and smsagent current versions.
$(basename $0) <version> -- Update version number to <version>."
$(basename $0) -h -- Show this help.
$(basename $0) ask -- Show current version.
$(basename $0) update <version> -- Update version number to <version>."

if [ "$1" = "" -o "$1" = "-h" ]; then
echo "$USAGE"
elif [ "$1" = "ask" ]; then
echo -n "libsera: "
grep 'REALNAME:=' Makefile | cut -c 21-
else
sed -i --follow-symlinks '/REALNAME:=/c\REALNAME:=$(SONAME).'"$1" Makefile
sed -i --follow-symlinks "/PROJECT_NUMBER/c\PROJECT_NUMBER = $1" Doxyfile
sed -i --follow-symlinks "s/Version [0-9]\.[0-9][0-9]*/Version $1/" doc/title.tex
elif [ "$1" = "update" ]; then
sed -i --follow-symlinks '/REALNAME:=/c\REALNAME:=$(SONAME).'"$2" Makefile.template
sed -i --follow-symlinks "/PROJECT_NUMBER/c\PROJECT_NUMBER = $2" Doxyfile
sed -i --follow-symlinks "s/Version [0-9]\.[0-9][0-9]*/Version $2/" doc/title.tex
fi
exit 0

0 comments on commit 4d13142

Please sign in to comment.