Publish script.

This commit is contained in:
baldo 2016-06-11 19:08:46 +02:00
parent 697ad50f1d
commit 3fb3eb437f
3 changed files with 50 additions and 2 deletions

25
publish.sh Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -e
cd $(dirname $0)
version=$(grep '^ *"version": *"[^"]*" *, *$' package.json | cut -d '"' -f4)
if [ -z "$version" ]; then
echo "Could not determine current version."
exit 1
fi
echo "Current version: $version"
if [[ $version =~ 'SNAPSHOT' ]]; then
echo "Will not publish SNAPSHOT version."
exit 1
fi
./node_modules/.bin/grunt clean build
cd dist
npm publish