Bake in git commit into dendritejs binary (#1048)

main
Kegsay 2020-05-19 16:42:30 +01:00 committed by GitHub
parent 8b3100935c
commit 5faecdac82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

4
build-dendritejs.sh Executable file
View File

@ -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

View File

@ -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"