forked from uber/react-vis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·49 lines (38 loc) · 910 Bytes
/
publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
DRY_RUN=0
while true; do
case $1 in
-v | --version ) VERSION=$2; shift 2 ;;
-t | --tag ) TAG=$2; shift 2 ;;
-r | --registry ) REGISTRY=$2; shift 2 ;;
--dry-run ) DRY_RUN=1; shift ;;
-- ) shift; break ;;
* ) break ;;
esac
done
if [ -z $VERSION ]
then
echo "Error: must specify version, with the -v option."
exit 0
fi
if [ -z $REGISTRY ]
then
echo "Registry unset, use the default npm registry https://registry.npmjs.org."
REGISTRY="https://registry.npmjs.org"
fi
cp CHANGELOG.md README.md LICENSE packages/react-vis
cd packages/react-vis
npm version $VERSION
publish_command="npm publish"
if [ -z $TAG ]
then
publish_command+=" --tag ${TAG} --registry ${REGISTRY}"
else
publish_command+=" --registry ${REGISTRY}"
fi
if [ $DRY_RUN -eq 1 ]
then
publish_command+=" --dry-run"
fi
eval $publish_command
rm CHANGELOG.md README.md LICENSE