Skip to content

Commit

Permalink
Added GoVersion to version
Browse files Browse the repository at this point in the history
  • Loading branch information
moloch-- committed Dec 19, 2020
1 parent 1fa2543 commit a1142e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ TAGS = -tags osusergo,netgo,sqlite_omit_load_extension
#
# Version Information
#
GO_VERSION = $(shell $(GO) version)
VERSION = $(shell git describe --abbrev=0)
COMPILED_AT = $(shell date +%s)
RELEASES_URL = https://api.github.com/repos/BishopFox/sliver/releases
Expand All @@ -17,6 +18,7 @@ GIT_DIRTY = $(shell git diff --quiet|| echo 'Dirty')
GIT_COMMIT = $(shell git rev-parse HEAD)
LDFLAGS = -ldflags "-s -w \
-X $(PKG).Version=$(VERSION) \
-X \"$(PKG).GoVersion=$(GO_VERSION)\" \
-X $(PKG).CompiledAt=$(COMPILED_AT) \
-X $(PKG).GithubReleasesURL=$(RELEASES_URL) \
-X $(PKG).GitCommit=$(GIT_COMMIT) \
Expand Down
3 changes: 2 additions & 1 deletion client/command/updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ func verboseVersions(ctx *grumble.Context, rpc rpcpb.SliverRPCClient) {

fmt.Printf(Info+"Client %s - %s/%s\n", clientVer, runtime.GOOS, runtime.GOARCH)
clientCompiledAt, _ := version.Compiled()
fmt.Printf(" Compiled at %s\n\n", clientCompiledAt)
fmt.Printf(" Compiled at %s\n", clientCompiledAt)
fmt.Printf(" Compiled with %s\n\n", version.GoVersion)

fmt.Println()
fmt.Printf(Info+"Server v%d.%d.%d - %s - %s/%s\n",
Expand Down
3 changes: 3 additions & 0 deletions client/version/sliver-version.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ var (
// Version - The semantic version in string form
Version string

// GoVersion - Go compiler version
GoVersion string

// GitCommit - The commit id at compile time
GitCommit string

Expand Down

0 comments on commit a1142e4

Please sign in to comment.