diff --git a/build/release.sh b/build/release.sh index 6138bbc..52e1b3a 100644 --- a/build/release.sh +++ b/build/release.sh @@ -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