2023-01-10 21:04:18 -05:00
|
|
|
#!/bin/bash
|
|
|
|
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
source $SCRIPTDIR/_script_common
|
|
|
|
|
|
|
|
pushd $SCRIPTDIR >/dev/null
|
|
|
|
|
|
|
|
# WASM output dir
|
2024-04-29 13:41:19 -04:00
|
|
|
WASMDIR=$APPDIR/web/wasm
|
2023-01-10 21:04:18 -05:00
|
|
|
|
|
|
|
# Build veilid-wasm, passing any arguments here to the build script
|
|
|
|
pushd $VEILIDDIR/veilid-wasm >/dev/null
|
|
|
|
PKGDIR=$(./wasm_build.sh $@ | grep SUCCESS:OUTPUTDIR | cut -d= -f2)
|
|
|
|
popd >/dev/null
|
|
|
|
|
|
|
|
# Copy wasm blob into place
|
|
|
|
echo Updating WASM from $PKGDIR to $WASMDIR
|
|
|
|
if [ -d $WASMDIR ]; then
|
|
|
|
rm -f $WASMDIR/*
|
|
|
|
fi
|
|
|
|
mkdir -p $WASMDIR
|
|
|
|
cp -f $PKGDIR/* $WASMDIR/
|
|
|
|
|
|
|
|
#### Done
|
|
|
|
|
|
|
|
popd >/dev/null
|