diff --git a/build-dendritejs.sh b/build-dendritejs.sh new file mode 100755 index 000000000..cd42a6bee --- /dev/null +++ b/build-dendritejs.sh @@ -0,0 +1,4 @@ +#!/bin/bash -eu + +export GIT_COMMIT=$(git rev-list -1 HEAD) && \ +GOOS=js GOARCH=wasm go build -ldflags "-X main.GitCommit=$GIT_COMMIT" -o main.wasm ./cmd/dendritejs \ No newline at end of file diff --git a/cmd/dendritejs/main.go b/cmd/dendritejs/main.go index 618ebbc60..5bdf18efa 100644 --- a/cmd/dendritejs/main.go +++ b/cmd/dendritejs/main.go @@ -46,8 +46,10 @@ import ( _ "github.com/matrix-org/go-sqlite3-js" ) +var GitCommit string + func init() { - fmt.Println("dendrite.js starting...") + fmt.Printf("[%s] dendrite.js starting...\n", GitCommit) } const keyNameEd25519 = "_go_ed25519_key"