-
Notifications
You must be signed in to change notification settings - Fork 5
/
DIST.sh
74 lines (64 loc) · 1.63 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# DIST.sh
#
# David Janes
# IOTDB
# 2014-12-04
#
# Distribute iotdb-homestar to NPM
#
DO_NPM_IOTDB_PACKAGE=true
DIST_ROOT=/var/tmp/iotdb-homestar.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_SRC=../iotdb-homestar
cd $NPM_SRC || exit 1
NPM_DST=$DIST_ROOT/iotdb-homestar
echo "NPM_DST=$NPM_DST"
if [ -d ${NPM_DST} ]
then
rm -rf "${NPM_DST}"
fi
mkdir "${NPM_DST}" || exit 1
update-package --increment-version || exit 1
## python -c "
##import json
##
##filename = 'package.json'
##jd = json.load(open(filename))
##versions = jd['version'].split('.')
##versions[-1] = '%d' % ( int(versions[-1]) + 1, )
##jd['version'] = '.'.join(versions)
##json.dump(jd, open(filename, 'w'), sort_keys=True, indent=4)
##print 'new package version:', jd['version']
##" || exit 1
export COPYFILE_DISABLE=1
tar cf - \
--exclude "xx*" \
--exclude "yy*" \
--exclude ".iotdb" \
--exclude "node_modules" \
--exclude "Gruntfile.js" \
README.md \
LICENSE.txt \
package.json \
homestar.js \
app/*.js \
bin/homestar \
bin/commands \
dynamic static interactors \
| ( cd "${NPM_DST}" && tar xvf - && npm publish ) || exit 1
git commit -m "new release" package.json || exit 1
git push || exit 1
echo "end"
)
fi