Bun requires an absolute path

This commit is contained in:
Frank Denis 2022-12-19 10:21:48 +01:00
parent c3c2595bd7
commit 45da50ab0e

View File

@ -39,7 +39,7 @@ if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "bun" ]; then
{
echo "import fs from 'fs'; import { init, WASI } from '@wasmer/wasi';"
echo "await init();"
echo "const wasi = new WASI({args: process.argv, env: process.env, preopens: {'.':'.'}});"
echo "const wasi = new WASI({args: process.argv, env: process.env, preopens: {'.':'/'}});"
echo "await (async function() {"
echo " const wasm = await WebAssembly.compile(fs.readFileSync('${1}'));"
echo " await wasi.instantiate(wasm, {});"