Bake in git commit into dendritejs binary
ADD
build-dendritejs.sh
+#!/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

MODIFY
cmd/dendritejs/main.go
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"

Bake in git commit into dendritejs binary (#1048)