1
0
Fork 0

Modified tools/version to update package.json and configure.ac

perfodd
Mike Gerwitz 2013-12-21 01:49:48 -05:00
parent 10bf2540c7
commit 6c4c2322bb
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
1 changed files with 11 additions and 3 deletions

View File

@ -23,7 +23,9 @@
major="$1"
minor="$2"
rev="$3"
suffix="$4"
suffix="${4:+-$4}"
version="$major.$minor.$rev$suffix"
# pre-formatted suffix
fsuffix=
@ -34,11 +36,17 @@ cat version.js.tpl | sed "
s/@MAJOR@/$major/;
s/@MINOR@/$minor/;
s/@REV@/$rev/;
s/@SUFFIX@/$suffix/;
s/@SUFFIX@/${suffix#-}/;
" > ../lib/version.js
# output version for docs
cat - > ../doc/version.texi <<EOF
@c DO NOT MODIFY; generated by verset (not autoconf)
@set VERSION $major.$minor.$rev$fsuffix
@set VERSION $version
EOF
# update package.json for npm
sed -i 's/"version":.*/"version": "'$version'",/' ../package.json
# update configure script by replacing the second argument of AC_INIT
sed -i '/^AC_INIT/s/, \[[^]]\+\]/, ['$version']/' ../configure.ac