forked from moodlehq/moodlemobile-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare-release-integration.sh
executable file
·67 lines (65 loc) · 2.07 KB
/
prepare-release-integration.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
#!/bin/bash
#
# Script for preparing the release version (phonegapbuild compatible)
#
MASTER_PATH="/Users/juanleyvadelgado/Documents/MoodleMobile/moodlemobile2"
PB_PATH="/Users/juanleyvadelgado/Documents/MoodleMobile/moodlemobile-phonegapbuild"
cd $MASTER_PATH
git checkout integration
git fetch moodlehq
git reset --hard moodlehq/integration
bower install
bower update
gulp
cd $PB_PATH
git checkout integration
git pull
cp -pr $MASTER_PATH/www/* $PB_PATH/
# Delete not-required files.
find addons -name "*.js" -type f -delete
find core -name "*.js" -type f -delete
find addons -name "*.json" -type f -delete
find core -name "*.json" -type f -delete
find addons -name "*.scss" -type f -delete
find core -name "*.scss" -type f -delete
find . -name "*bower.json" -type f -delete
find . -name "*.md" -type f -delete
find . -name "*README*" -type f -delete
find . -name "*LICENSE*" -type f -delete
find . -name "*.gzip" -type f -delete
find . -name ".gitignore" -type f -delete
find lib -name "package.json" -type f -delete
sed -i bak -e 's/ionic.bundle.js/ionic.bundle.min.js/' index.html
rm lib/ionic/release/js/ionic.bundle.js
rm lib/ionic/release/js/ionic.js
rm lib/ionic/release/js/ionic-angular.js
rm index.htmlbak
rm -rf lib/ionic/demos
rm -rf lib/ionic/js
rm -rf lib/angular-md5/example
rm -rf lib/angular-ui-router/src
rm -rf lib/moment/src
rm -rf lib/ionic/scss
rm -rf lib/ckeditor/samples
rm -rf lib/jszip/docs
rm -rf lib/jszip/documentation
rm -rf lib/ydn.db/test
rm -rf lib/ydn.db/example
rm -rf lib/ydn.db/src
rm -rf lib/chart.js/docs
rm -rf lib/chart.js/test
rm -rf lib/chart.js/src
rm -rf lib/chart.js/samples
rm -rf lib/chart.js/scripts
cp -pr $MASTER_PATH/www/core/assets/* $PB_PATH/core/assets/
# Commit and push.
if [ $# -eq 1 ]
then
git commit -am "Sync with master"
git rebase master android
git rebase master ios
git push --force
fi
#sed -e 's/version = "[^"]*"/version = ""/' $PB_PATH/config.xml > index.html.tmp && mv index.html.tmp index.html
#sed -e 's/versionCode = "[^"]*"/versionCode = ""/' $PB_PATH/config.xml
#sed -e 's/<string>[^<]*"/<string>/' $PB_PATH/config.xml