summaryrefslogtreecommitdiff
path: root/crates/wipfel/serve-here.sh
diff options
context:
space:
mode:
Diffstat (limited to 'crates/wipfel/serve-here.sh')
-rwxr-xr-xcrates/wipfel/serve-here.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/wipfel/serve-here.sh b/crates/wipfel/serve-here.sh
new file mode 100755
index 0000000..9667965
--- /dev/null
+++ b/crates/wipfel/serve-here.sh
@@ -0,0 +1,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/style.css "$DIST/"
+gzip -9 -n -c gipfel.dat > "$DIST/gipfel.dat.gz"
+echo "dist refreshed: $(ls -la "$DIST" | awk '{s+=$5} END {print s" bytes"}')"