mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-08 18:16:59 +00:00
7048532bc4
* Add version tag constant * Update build imprinting
20 lines
603 B
Bash
Executable File
20 lines
603 B
Bash
Executable File
#!/bin/bash -eu
|
|
|
|
# Put installed packages into ./bin
|
|
export GOBIN=$PWD/`dirname $0`/bin
|
|
|
|
if [ -d ".git" ]
|
|
then
|
|
export BUILD=`git rev-parse --short HEAD || ""`
|
|
export BRANCH=`(git symbolic-ref --short HEAD | tr -d \/ ) || ""`
|
|
[[ $BRANCH == "master" ]] && export BRANCH=""
|
|
|
|
export FLAGS="-X github.com/matrix-org/dendrite/internal.branch=$BRANCH -X github.com/matrix-org/dendrite/internal.build=$BUILD"
|
|
else
|
|
export FLAGS=""
|
|
fi
|
|
|
|
go install -trimpath -ldflags "$FLAGS" -v $PWD/`dirname $0`/cmd/...
|
|
|
|
GOOS=js GOARCH=wasm go build -trimpath -ldflags "$FLAGS" -o main.wasm ./cmd/dendritejs
|