refactor setup

This commit is contained in:
Christien Rioux 2023-11-16 07:51:55 -05:00
parent bbde85a134
commit e8046e9a89
9 changed files with 96 additions and 42 deletions

25
dev-setup/wasm_update.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPTDIR/_script_common
pushd $SCRIPTDIR >/dev/null
# WASM output dir
WASMDIR=$VEILIDCHATDIR/web/wasm
# 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