mirror of
https://github.com/fluencelabs/aquavm
synced 2025-03-28 02:11:03 +00:00
* preparation * trying to automate * fix * implement logic in powershell * fix * tmp * tmp * fix * remove debug stuff * newline in gitignore * Remove debug echos
27 lines
758 B
Bash
Executable File
27 lines
758 B
Bash
Executable File
#!/bin/sh
|
|
|
|
## requires wasm-pack
|
|
## > curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
|
|
(
|
|
cd ../..;
|
|
mkdir -p ./avm/client/wasm || exit;
|
|
wasm-pack build ./air-interpreter --no-typescript --release -d ../avm/client/wasm
|
|
)
|
|
|
|
cat << EOF > ./src/wasm.js
|
|
// auto-generated
|
|
|
|
module.exports = "$(base64 -w0 wasm/air_interpreter_client_bg.wasm)";
|
|
EOF
|
|
|
|
callserviceimpl=$(cat wasm/air_interpreter_client_bg.js | grep -o '__wbg_callserviceimpl_\w*')
|
|
getcurrentpeeridimpl=$(cat wasm/air_interpreter_client_bg.js | grep -o '__wbg_getcurrentpeeridimpl_\w*')
|
|
|
|
cat << EOF > ./src/importObject.ts
|
|
// auto-generated
|
|
|
|
export const __wbg_callserviceimpl = "$callserviceimpl";
|
|
export const __wbg_getcurrentpeeridimpl = "$getcurrentpeeridimpl";
|
|
EOF
|