2017-09-20 22:30:38 +10:00
|
|
|
#!/bin/bash
|
|
|
|
# Eos - Verifiable elections
|
2019-01-14 17:54:31 +11:00
|
|
|
# Copyright © 2017-2019 RunasSudo (Yingtong Li)
|
2017-09-20 22:30:38 +10:00
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2017-12-05 09:43:39 +11:00
|
|
|
FLAGS="-k -mc -o"
|
2017-09-20 22:30:38 +10:00
|
|
|
|
2017-09-25 15:19:48 +10:00
|
|
|
#for f in eos.js eos.js_tests; do
|
|
|
|
for f in eos.js_tests; do
|
2017-12-05 09:43:39 +11:00
|
|
|
transcrypt -b -n $FLAGS $f.py || exit 1
|
2017-09-25 11:46:59 +10:00
|
|
|
done
|
2017-11-23 21:07:16 +11:00
|
|
|
|
2019-01-14 17:54:31 +11:00
|
|
|
# Transcrypt syntax errors
|
|
|
|
perl -0777 -pi -e 's/import \{, /import \{/g' __target__/eos*.js
|
|
|
|
|
|
|
|
# Add export
|
|
|
|
echo >> __target__/eos.js_tests.js
|
|
|
|
echo 'export {eos, __kwargtrans__};' >> __target__/eos.js_tests.js
|
|
|
|
|
|
|
|
# Convert to ES5
|
|
|
|
./node_modules/.bin/browserify -t babelify -r ./__target__/eos.js_tests.js:eosjs > eosweb/core/static/js/eosjs.js
|