diff --git a/scripts/bower/publish.sh b/scripts/bower/publish.sh index 7af024b78c93..b7505092e441 100755 --- a/scripts/bower/publish.sh +++ b/scripts/bower/publish.sh @@ -73,6 +73,8 @@ function prepare { cd $TMP_DIR/bower-$repo replaceJsonProp "bower.json" "version" ".*" "$NEW_VERSION" replaceJsonProp "bower.json" "angular.*" ".*" "$NEW_VERSION" + replaceJsonProp "package.json" "version" ".*" "$NEW_VERSION" + replaceJsonProp "package.json" "angular.*" ".*" "$NEW_VERSION" git add -A @@ -90,6 +92,18 @@ function publish { cd $TMP_DIR/bower-$repo git push origin master git push origin v$NEW_VERSION + + # don't publish every build to npm + if [ "${NEW_VERSION/+sha}" = "$NEW_VERSION" ] ; then + if [ "${NEW_VERSION/-}" = "$NEW_VERSION" ] ; then + # publish releases as "latest" + npm publish + else + # publish prerelease builds with the beta tag + npm publish --tag=beta + fi + fi + cd $SCRIPT_DIR done }