2022-11-26 10:40:06 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This is a helper script to deploy all WebAssembly examples to my node
|
|
|
|
# Run from the build directory:
|
|
|
|
#
|
|
|
|
# cd build-em
|
|
|
|
# ../extra/deploy-wasm.sh
|
|
|
|
#
|
|
|
|
|
|
|
|
# check if emcmake is available
|
|
|
|
if ! command -v emcmake &> /dev/null
|
|
|
|
then
|
|
|
|
echo "Error: emscripten environment is not set up"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
emcmake cmake .. && make -j
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Error: build failed"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
# copy all wasm files to the node
|
2022-12-12 19:17:27 +01:00
|
|
|
scp bin/whisper.wasm/* root@linode0:/var/www/html/whisper/ && scp bin/libmain.worker.js root@linode0:/var/www/html/whisper/
|
2022-11-26 10:40:06 +01:00
|
|
|
scp bin/stream.wasm/* root@linode0:/var/www/html/whisper/stream/ && scp bin/libstream.worker.js root@linode0:/var/www/html/whisper/stream/
|
|
|
|
scp bin/command.wasm/* root@linode0:/var/www/html/whisper/command/ && scp bin/libcommand.worker.js root@linode0:/var/www/html/whisper/command/
|
|
|
|
scp bin/talk.wasm/* root@linode0:/var/www/html/whisper/talk/ && scp bin/libtalk.worker.js root@linode0:/var/www/html/whisper/talk/
|
2022-12-11 10:09:01 +01:00
|
|
|
scp bin/bench.wasm/* root@linode0:/var/www/html/whisper/bench/ && scp bin/libbench.worker.js root@linode0:/var/www/html/whisper/bench/
|
2022-11-26 10:40:06 +01:00
|
|
|
|
|
|
|
echo "Done"
|
|
|
|
exit
|