angular-docs-cn/publish-packages.sh

37 lines
800 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -ex
cd `dirname $0`
VERSION=$1
if [[ "${VERSION}" == "" ]]
then
echo "Version number required"
exit 1
fi
./build.sh
echo "====== RENAMING \$\$ANGULAR_VERSION\$\$ to 0.0.0-${VERSION} ======"
find ./dist/packages-dist/ -type f -name package.json -print0 | xargs -0 sed -i '' "s/\\\$\\\$ANGULAR_VERSION\\\$\\\$/2.0.0-rc.${VERSION}/g"
find ./dist/packages-dist/ -type f -name "*umd.js" -print0 | xargs -0 sed -i '' "s/\\\$\\\$ANGULAR_VERSION\\\$\\\$/2.0.0-rc.${VERSION}/g"
for PACKAGE in \
core \
compiler \
compiler_cli \
common \
http \
platform-browser \
platform-server \
router \
router-deprecated \
upgrade
do
DESTDIR=./dist/packages-dist/${PACKAGE}
echo "====== PUBLISHING: ${DESTDIR} ====="
npm publish ${DESTDIR} --access public
done