-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
22 lines (22 loc) · 719 Bytes
/
Copy pathpublish.sh
File metadata and controls
22 lines (22 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
if npm run test; then
rm -rf dist
npm run build
cp package.json dist/package.json
cp README.md dist/README.md
cd dist
if [ "$1" == "dry" ]; then
echo "Dry Run..."
npm publish --access public --dry-run || { echo "Publish failed"; exit 1; }
elif [ "$1" == "alpha" ]; then
echo "Publishing alpha..."
npm publish --access public --tag alpha || { echo "Publish failed"; exit 1; }
elif [ "$1" == "beta" ]; then
echo "Publishing beta..."
npm publish --access public --tag beta || { echo "Publish failed"; exit 1; }
else
echo "Publishing main version..."
npm publish --access public || { echo "Publish failed"; exit 1; }
fi
else
echo "Some test failed, aborting publish"
fi