Skip to content

Commit 10cc6de

Browse files
chore(scripts/publish): get dist-tag from package.json
1 parent 7d2c6ee commit 10cc6de

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"license": "MIT",
44
"branchVersion": "^1.4.0-beta.0",
55
"branchPattern": "1.4.*",
6+
"distTag": "latest",
67
"repository": {
78
"type": "git",
89
"url": "https://github.com/angular/angular.js.git"

scripts/bower/publish.sh

+4-13
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,10 @@ function publish {
9595

9696
# don't publish every build to npm
9797
if [ "${NEW_VERSION/+sha}" = "$NEW_VERSION" ] ; then
98-
if [ "${NEW_VERSION/-}" = "$NEW_VERSION" ] ; then
99-
if [[ $NEW_VERSION =~ ^1\.2\.[0-9]+$ ]] ; then
100-
# publish 1.2.x releases with the appropriate tag
101-
# this ensures that `npm install` by default will not grab `1.2.x` releases
102-
npm publish --tag=old
103-
else
104-
# publish releases as "latest"
105-
npm publish
106-
fi
107-
else
108-
# publish prerelease builds with the beta tag
109-
npm publish --tag=beta
110-
fi
98+
# get the npm dist-tag from a custom property (distTag) in package.json
99+
DIST_TAG=$(readJsonProp "package.json" "distTag")
100+
echo "-- Publishing to npm as $DIST_TAG"
101+
npm publish --tag=$DIST_TAG
111102
fi
112103

113104
cd $SCRIPT_DIR

0 commit comments

Comments
 (0)