storj/web/satellite/scripts/build-wasm.sh
dlamarmorgan 9022506292 web/satellite: allow execute permissions on wasm_exec
Execute permissions are needed on the wasm_exec.js file but nothing seems to set this by default. Once set, it will keep permissions even after rebuilds, but this change will set the initial permissions if required for any new environments.

Change-Id: Ic6848e561210231e67dd2e17a286abdf885926ed
2022-11-21 11:20:53 -08:00

16 lines
467 B
Bash
Executable File

#!/usr/bin/env bash
# Copy wasm javascript to match the go version
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./static/wasm
# Compress wasm javascript using brotli
brotli -k -f ./static/wasm/wasm_exec.js
# Build wasm code
GOOS=js GOARCH=wasm go build -o ./static/wasm/access.wasm storj.io/storj/satellite/console/wasm
# Compress wasm code using brotli
brotli -k -f ./static/wasm/access.wasm
# Allow execution of wasm_exec.js
chmod +x ./static/wasm/wasm_exec.js