add old releases in a folder

This commit is contained in:
Marcos Moura 2016-11-29 02:32:22 -02:00
parent d00992e3fc
commit b742be9cad

View file

@ -3,6 +3,14 @@
set -e
function get_package_version {
echo $(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
}
if [[ -z $1 ]]; then
echo "Enter new version: "
read VERSION
@ -15,10 +23,17 @@ echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Releasing $VERSION ..."
# check errors
npm run lint
# generate docs tree
PACKAGE_VERSION=$(get_package_version)
cp -Rf dist/docs tmp-docs
# build
VERSION=$VERSION npm run build
cp -Rf tmp-docs dist/docs/v$PACKAGE_VERSION
rm -Rf tmp-docs
# commit
git add -A