Skip to content

Commit

Permalink
Add revision and runtime info
Browse files Browse the repository at this point in the history
  • Loading branch information
tomohiro committed Nov 27, 2019
1 parent d0be48f commit 0ce8ebb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
OWNER = "tomohiro"
REPOSITORY = $(shell basename $(PWD))
VERSION = $(shell grep "const Version " $(PWD)/version.go | sed -E 's/.*"(.+)"$$/\1/')
REVISION = $(shell git rev-parse --short HEAD)

# Build information
DIST_DIR = $(PWD)/dist
ASSETS_DIR = $(DIST_DIR)/$(VERSION)
XC_OS = "linux darwin windows"
XC_ARCH = "386 amd64"
BUILD_LDFLAGS = "-w -s"
BUILD_LDFLAGS = "-w -s -X main.revision=$(REVISION)"

# Tasks
help:
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func realMain() int {
Usage: "Gyazo command-line uploader",
UsageText: "gyazo-cli [global options] [PATH]",
Action: upload,
Version: fmt.Sprintf("%s-%s (build/%s)", Version, revision, runtime.Version()),
Version: fmt.Sprintf("%s (rev %s) [%s %s %s]", Version, revision, runtime.GOOS, runtime.GOARCH, runtime.Version()),
Authors: []*cli.Author{
&cli.Author{
Name: "Tomohiro Taira",
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package main
// Version number that is being run at the moment.
const Version string = "1.0.0"

const revision string = "devel"
var revision string = "devel"

0 comments on commit 0ce8ebb

Please sign in to comment.