-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathmofowallet.sh
53 lines (47 loc) · 1.41 KB
/
mofowallet.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
# ##############################################################################
#
# Builds mofowallet web edition and publishes the result on mofowallet.com
#
# ##############################################################################
echo "start building mofowallet"
VERSION=`cat VERSION`
MODE_JS_FILE='app/mode.js'
MODE_JS=$(cat <<'END_HEREDOC'
/* This file is autogenerated by the build system */
var VERSION='#VERSION#';
var ENABLE_DUAL_ENGINES=true;
var IS_TEST_NET=false;
var FORCE_LOCAL_HOST=false;
var WALLET_NAME='Lompsa.com';
var TRADE_UI_ONLY=false;
var DEBUG=false;
var BUILD_TIMESTAMP=#TIMESTAMP#;
END_HEREDOC
)
cat > $MODE_JS_FILE <<EOF
$MODE_JS
EOF
orig=#VERSION#
sed -i "s/${orig}/${VERSION}/g" $MODE_JS_FILE
orig=#TIMESTAMP#
timestamp=$(date +%s)
sed -i "s/${orig}/${timestamp}/g" $MODE_JS_FILE
grunt build
echo "successfully built mofowallet"
# copy over all code to git/mofo
echo "copy mofo files to jekyll repo"
MOFO_FILES="dist/fonts dist/images dist/partials \
dist/plugins dist/scripts dist/styles dist/favicon.ico \
dist/i18n dist/mode.js dist/dice-words dist/ZeroClipboard.swf"
cp -r -p $MOFO_FILES ~/git/mofo
cp dist/index.html ~/git/mofo/launch.html
DATE=`date`
echo "<!--$DATE-->" >> ~/git/mofo/launch.html
echo "successfully copied mofo files to jekyll repo"
cd ~/git/mofo
echo "start jekyll build"
bundle exec jekyll build
echo "done"
git add --all
git commit -am 'Update mofo'
git push origin gh-pages