forked from metaverse/truss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wininstall.bat
30 lines (25 loc) · 920 Bytes
/
wininstall.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@ECHO OFF
SET SHA_CMD="git rev-parse --short=10 HEAD"
FOR /F "tokens=* USEBACKQ" %%F IN (`%SHA_CMD%`) DO (
SET SHA=%%F
)
SET HEAD_CMD="git rev-parse HEAD"
FOR /F "tokens=* USEBACKQ" %%F IN (`%HEAD_CMD%`) DO (
SET HEAD_COMMIT=%%F
)
SET HEAD_DATE_CMD="git show -s --format=%%ct %HEAD_COMMIT%"
FOR /F "tokens=* USEBACKQ" %%F IN (`%HEAD_DATE_CMD%`) DO (
SET GIT_COMMIT_EPOC=%%F
)
SET DATE_FMT_CMD="go-datefmt -ts %GIT_COMMIT_EPOC% -fmt UnixDate -utc"
FOR /F "tokens=* USEBACKQ" %%F IN (`%DATE_FMT_CMD%`) DO (
SET HEAD_DATE=%%F
)
@ECHO ON
go get github.com/pauln/go-datefmt
go get github.com/gogo/protobuf/protoc-gen-gogo
go get github.com/gogo/protobuf/proto
go get github.com/jteeuwen/go-bindata/...
go generate github.com/metaverse/truss/gengokit/template
go install -ldflags "-X 'main.Version=%SHA%' -X 'main.VersionDate=%HEAD_DATE%'" github.com/metaverse/truss/cmd/truss
@ECHO OFF