-
Notifications
You must be signed in to change notification settings - Fork 0
/
DIST.sh
46 lines (39 loc) · 849 Bytes
/
DIST.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
#
# DIST.sh
#
# David Janes
# IOTDB
# 2019-04-26
#
PACKAGE=iotdb-datatables
DIST_ROOT=/var/tmp/.dist.$$
if [ ! -d "$DIST_ROOT" ]
then
mkdir "$DIST_ROOT"
fi
echo "=================="
echo "NPM Packge: $PACKAGE"
echo "=================="
(
NPM_DST="$DIST_ROOT/$PACKAGE"
echo "NPM_DST=$NPM_DST"
if [ -d ${NPM_DST} ]
then
rm -rf "${NPM_DST}"
fi
mkdir "${NPM_DST}" || exit 1
update-package --increment-version --package "$PACKAGE" || exit 1
tar cf - \
--exclude "node_modules" \
--exclude "xx*" \
--exclude "yy*" \
README.md LICENSE \
package.json \
index.js \
lib/*.js \
|
( cd "${NPM_DST}" && tar xvf - && npm publish ) || exit 1
git commit -m "new release" package.json || exit 1
git push || exit 1
echo "end"
)