-
Notifications
You must be signed in to change notification settings - Fork 1
/
DIST.sh
44 lines (37 loc) · 864 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
#
# DIST.sh
#
# David Janes
# IOTDB
# 2015-02-10
#
PACKAGE=homestar-lifx
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" --homestar || exit 1
tar cf - \
--exclude "node_modules" \
README.md LICENSE \
homestar.json package.json \
LIFXBridge.js index.js products.json \
models/*.js models/*.json \
|
( cd "${NPM_DST}" && tar xvf - && npm publish ) || exit 1
git commit -m "new release" package.json || exit 1
git push || exit 1
echo "end"
)