Don't clobber `dev` tag from PR builds
@@ -12,6 +12,10 @@ if [[ "${TRAVIS_PUBLISH_PACKAGES:-}" == "true" ]]; then
echo "Publishing NPM package to NPMjs.com:"
NPM_TAG="dev"
+ if [[ "${TRAVIS_BRANCH:-}" == features/* ]]; then
+ NPM_TAG=$(echo "${TRAVIS_BRANCH}" | sed -e 's|^features/|feature-|g')
+ fi
+
# If the package doesn't have a pre-release tag, use the tag of latest instead of
# dev. NPM uses this tag as the default version to add, so we want it to mean
# the newest released version.
