#!/bin/sh

wsm="./rs-x2sheets.wasm"

ifile1="./sample.d/input1.xlsx"
ifile2="./sample.d/input2.xlsx"

geninput(){
    mkdir -p sample.d
    ifile=${ifile1} python3 geninput.py
    ifile=${ifile2} python3 geninput.py
}

test -f "${ifile1}" || geninput
test -f "${ifile2}" || geninput

cat "${ifile1}" | wasmtime run "${wsm}" --max-input-bytes=128
cat "${ifile2}" | wasmtime run "${wsm}" --max-input-bytes=1048576
