forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.sh
executable file
·59 lines (43 loc) · 1.42 KB
/
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
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
ARG_DEFS=(
)
echo "##### "
echo "##### bower/publish.sh"
echo "#####"
function init {
BOWER_DIR=$HOME/ionic-bower
../clone/clone.sh --repository="driftyco/ionic-bower" \
--depth="1" \
--directory="$BOWER_DIR" \
--branch="master"
}
function run {
cd ../..
VERSION=$(readJsonProp "package.json" "version")
CODENAME=$(readJsonProp "package.json" "codename")
echo "-- Putting build files in ionic-bower..."
node_modules/.bin/gulp build --release --dist=$BOWER_DIR
cp -Rf scss $BOWER_DIR
# Angular dependencies are managed by bower, don't include them
# We also don't need a changelog or version.json
rm -rf $BOWER_DIR/{js/angular*,CHANGELOG*,version.json}
echo "-- Copying bower.json from project_dir and renaming main files"
node -p "var b = require('./bower.json');
delete b.ignore;
b.main = b.main.map(function(s) {
return s.replace(/^release\//,'');
});
JSON.stringify(b,null,2);" \
> $BOWER_DIR/bower.json
cd $BOWER_DIR
echo "-- Updating version in ionic-bower to $VERSION"
replaceJsonProp "bower.json" "version" "$VERSION"
echo "-- Updating codename in ionic-bower to $CODENAME"
replaceJsonProp "bower.json" "codename" "$CODENAME"
git add -A
git commit -am "release: v$VERSION"
git tag -f -m v$VERSION v$VERSION
git push -q --tags origin master
echo "-- Published ionic-bower v$VERSION successfully!"
}
source $(dirname $0)/../utils.inc