remove ytbn prefix for js and wasm files

This commit is contained in:
Simon Gardling 2022-04-20 19:10:13 -04:00
parent aad08d06ab
commit 089aef48ad

View File

@ -18,7 +18,7 @@ if test "$1" == "" || test "$1" == "release"; then
wasm_opt #apply wasm optimizations
echo "Binary size (pre-strip): $(du -sb pkg/ytbn_graphing_software_bg.wasm)"
llvm-strip --strip-all pkg/ytbn_graphing_software_bg.wasm
elif test "$1" == "debug"; then
elif test "$1" == "debug"; then
RUSTFLAGS=--cfg=web_sys_unstable_apis wasm-pack build --target web --debug --no-typescript
else
echo "ERROR: build.sh, argument invalid"
@ -39,11 +39,10 @@ wasm_sum=($(md5sum tmp/ytbn_graphing_software_bg.wasm))
js_sum=($(md5sum tmp/ytbn_graphing_software.js))
sum=($(echo "$wasm_sum $js_sum" | md5sum))
echo $sum
new_wasm_name="ytbn_${sum}.wasm"
new_js_name="ytbn_${sum}.js"
echo "sum: $sum"
new_wasm_name="${sum}.wasm"
new_js_name="${sum}.js"
mv tmp/ytbn_graphing_software_bg.wasm "tmp/${new_wasm_name}"