-
Notifications
You must be signed in to change notification settings - Fork 10
/
DIST.sh
53 lines (45 loc) · 1.05 KB
/
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
47
48
49
50
51
52
53
#
# DIST.sh
#
# David Janes
# IOTDB
# 2014-04-18
#
# Distribute iotdb to NPM
#
DO_NPM_IOTDB_PACKAGE=true
DIST_ROOT=/var/tmp/node-iotdb.dist.$$
IOTDB_ROOT=$HOME/iotdb
if [ ! -d "$DIST_ROOT" ]
then
mkdir "$DIST_ROOT"
fi
if $DO_NPM_IOTDB_PACKAGE
then
echo "=================="
echo "NPM Packge: iotdb"
echo "=================="
(
NPM_IOTDB_SRC=../node-iotdb
cd $NPM_IOTDB_SRC || exit 1
NPM_IOTDB_DST=$DIST_ROOT/iotdb
echo "NPM_IOTDB_DST=$NPM_IOTDB_DST"
if [ -d ${NPM_IOTDB_DST} ]
then
rm -rf "${NPM_IOTDB_DST}"
fi
mkdir "${NPM_IOTDB_DST}" || exit 1
update-package --increment-version || exit 1
tar cf - \
--exclude "xx*" \
--exclude "yy*" \
README.md \
LICENSE.txt \
*.js *.json helpers/*js \
|
( cd "${NPM_IOTDB_DST}" && tar xvf - && npm publish ) || exit 1
git commit -m "new release" package.json || exit 1
git push || exit 1
echo "end"
)
fi