diff --git a/Makefile b/Makefile index bfea746..6c2828d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ NAME=asciinema VERSION=$(shell grep 'const Version' main.go | awk -F '"' '{print $$2}') -COMMIT=$(shell git rev-parse --short HEAD) DIRS=bin INSTALL_DIRS=`find $(DIRS) -type d 2>/dev/null` @@ -15,7 +14,7 @@ DOC_DIR=$(PREFIX)/share/doc/$(NAME) all: build build: test - go build -o bin/asciinema -ldflags "-X main.GitCommit $(COMMIT)" + go build -o bin/asciinema test: go test ./... @@ -29,7 +28,7 @@ fmtdiff: travis: build fmtdiff gox: - gox -os="darwin freebsd linux" -arch="386 amd64" -output="bin/asciinema_{{.OS}}_{{.Arch}}" -ldflags "-X main.GitCommit $(COMMIT)" + gox -os="darwin freebsd linux" -arch="386 amd64" -output="bin/asciinema_{{.OS}}_{{.Arch}}" tag: git tag | grep "v$(VERSION)" && echo "Tag v$(VERSION) exists" && exit 1 || true @@ -65,6 +64,6 @@ RELEASE=asciinema-$(VERSION)-$(GOOS)-$(GOARCH) os-arch-tgz: mkdir -p dist/$(VERSION)/$(RELEASE) - go build -o dist/$(VERSION)/$(RELEASE)/asciinema -ldflags "-X main.GitCommit $(COMMIT)" + go build -o dist/$(VERSION)/$(RELEASE)/asciinema cp README.md CHANGELOG.md LICENSE dist/$(VERSION)/$(RELEASE) cd dist/$(VERSION) && tar czf $(RELEASE).tar.gz $(RELEASE) diff --git a/main.go b/main.go index 28a8b8b..04d5e62 100644 --- a/main.go +++ b/main.go @@ -14,8 +14,6 @@ import ( const Version = "1.1.1" -var GitCommit string // initialized during build - var usage = `Record and share your terminal sessions, the right way. Usage: @@ -79,13 +77,7 @@ func uintArg(args map[string]interface{}, name string, defaultValue uint) uint { } func formatVersion() string { - var commitInfo string - - if GitCommit != "" { - commitInfo = "-" + GitCommit - } - - return fmt.Sprintf("asciinema %v%v\n", Version, commitInfo) + return fmt.Sprintf("asciinema %v", Version) } func environment() map[string]string {