ffffng/publish.sh
2016-06-11 19:08:46 +02:00

26 lines
408 B
Bash
Executable file

#!/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