1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 10:05:05 -07:00

Bun: explicitly print the output of the wasm module to the console

This commit is contained in:
Frank Denis 2022-12-19 10:27:08 +01:00
parent 738eac1404
commit 3eb9e5a9a3

View File

@ -44,6 +44,7 @@ if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "bun" ]; then
echo " const wasm = await WebAssembly.compile(fs.readFileSync('${1}'));"
echo " await wasi.instantiate(wasm, {});"
echo " wasi.start();"
echo " console.log(wasi.getStdoutString());"
echo "})().catch(e => { console.error(e); process.exit(1); });"
} >"${1}.mjs"
bun run "${1}.mjs" 2>/tmp/err &&