2013-11-04 21:25:51 +04:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
#set -vx
|
|
|
|
|
|
|
|
function usage() {
|
|
|
|
echo USAGE $0 -v [version] -n [next version] -m [next milestone]
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
version=""
|
|
|
|
nextversion=""
|
|
|
|
nextmilestone=""
|
|
|
|
|
|
|
|
while getopts "v:n:m:" opt; do
|
|
|
|
case $opt in
|
|
|
|
v) version="$OPTARG"
|
|
|
|
;;
|
|
|
|
n) nextversion="$OPTARG"
|
|
|
|
;;
|
|
|
|
m) nextmilestone="$OPTARG"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "x" == "x$version" ]; then
|
|
|
|
echo ERROR: version not specified
|
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ "x" == "x$nextversion" ]; then
|
|
|
|
echo ERROR: next version not specified
|
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "x" == "x$nextmilestone" ]; then
|
|
|
|
echo ERROR: next milestone not specified
|
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
|
|
|
versiondir="select2-$version"
|
|
|
|
versionregex="${version//./\\.}"
|
|
|
|
nextversionregex="${nextversion//./\\.}"
|
|
|
|
|
|
|
|
echo "DOWNLOADING RELEASE"
|
|
|
|
wget "https://github.com/ivaynberg/select2/archive/$version.tar.gz"
|
|
|
|
tar xvzf "$version.tar.gz"
|
|
|
|
rm -f "$version.tar.gz"
|
|
|
|
|
|
|
|
rm index.html
|
|
|
|
cp select2-latest.html index.html
|
|
|
|
|
2014-03-23 06:37:54 +04:00
|
|
|
sed -e "s/title: Select2 Latest/title: Select2 $versionregex/" -ibak index.html
|
|
|
|
sed -e "s/select2-master\//select2-$versionregex\//" -ibak index.html
|
|
|
|
sed -e "/<!-- unreleased -->/d" -ibak index.html
|
|
|
|
sed -e "s/version: .*/version: $versionregex/" -ibak index.html
|
2013-11-04 21:25:51 +04:00
|
|
|
|
2014-03-23 06:37:54 +04:00
|
|
|
sed -e "s/version: .*/version: $nextversionregex/" -ibak select2-latest.html
|
|
|
|
sed -e "s/milestone: .*/milestone: $nextmilestone/" -ibak select2-latest.html
|
2013-11-04 21:25:51 +04:00
|
|
|
rm index.htmlbak
|
|
|
|
rm select2-latest.htmlbak
|
|
|
|
|
|
|
|
git add .
|
|
|
|
git commit -m "release $version"
|
|
|
|
|
2014-03-23 06:37:54 +04:00
|
|
|
echo
|
2013-11-04 21:25:51 +04:00
|
|
|
echo
|
|
|
|
echo DO NOT FORGET TO PUSH
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo PRESS ANY KEY TO START JEKYLL
|
|
|
|
read -n 1 -s
|
|
|
|
./jekyll.sh
|
|
|
|
|