-
Notifications
You must be signed in to change notification settings - Fork 0
/
ton-export.sh
29 lines (26 loc) · 1007 Bytes
/
ton-export.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
set -e
mkdir -p /output/wasm/
mkdir -p /output/js/
cp /build/output/deps.dot /output
cp /build/output/wasm/funcfiftlib.wasm \
/build/output/wasm/funcfiftlib.js \
/build/output/wasm/tlbc.wasm \
/build/output/wasm/tlbc.js \
/build/output/wasm/emulator-emscripten.wasm \
/build/output/wasm/emulator-emscripten.js \
/output/wasm
cp /build/output/js/emulator-emscripten.js \
/output/js
cd /output/wasm
# Create emulator-emscripten.wasm.js
echo -n "module.exports = { wasmBinary: '" > emulator-emscripten.wasm.js
cat emulator-emscripten.wasm | base64 --wrap=0 >> emulator-emscripten.wasm.js
echo -n "' };" >> emulator-emscripten.wasm.js
# Create funcfiftlib.wasm.js
echo -n "module.exports = { wasmBinary: '" > funcfiftlib.wasm.js
cat funcfiftlib.wasm | base64 --wrap=0 >> funcfiftlib.wasm.js
echo -n "' };" >> funcfiftlib.wasm.js
# Create tlbc.wasm.js
echo -n "module.exports = { wasmBinary: '" > tlbc.wasm.js
cat tlbc.wasm | base64 --wrap=0 >> tlbc.wasm.js
echo -n "' };" >> tlbc.wasm.js