summaryrefslogtreecommitdiff
path: root/crates/wipfel/serve-here.sh
blob: c43fbd8c2d41a0d65e67dffd0e9a35cd3ecfed02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
# Build wipfel for wasm and refresh the static dist dir served from
# /tmp/wipfel-dist (python http.server on :8090). Dev-only helper.
set -e
cd "$(dirname "$0")/../.."
cargo build -p wipfel --target wasm32-unknown-unknown --release
DIST=/tmp/wipfel-dist
mkdir -p "$DIST"
wasm-bindgen --target web --out-dir "$DIST" target/wasm32-unknown-unknown/release/wipfel.wasm
cp crates/wipfel/www/index.html crates/wipfel/www/style.css crates/wipfel/www/loader.js "$DIST/"
gzip -9 -n -c gipfel.dat > "$DIST/gipfel.dat.gz"
echo "dist refreshed: $(ls -la "$DIST" | awk '{s+=$5} END {print s" bytes"}')"