From a77e8e2c17330f98e21663b7332816ecf526bd03 Mon Sep 17 00:00:00 2001 From: mikkelam Date: Tue, 16 Jul 2024 21:30:54 +0200 Subject: [PATCH] do versioning slightly better --- Makefile | 4 ++-- main.go | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 17b7ace..4fcb3d4 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ GOCC := go # binary metadata -VERSION := $(shell git describe --always --tags) -COMMIT := $(shell git rev-parse HEAD) +VERSION ?= $(shell git describe --always --tags) +COMMIT ?= $(shell git rev-parse HEAD) DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ) GIT_COMMIT=$(shell git rev-parse HEAD) diff --git a/main.go b/main.go index e62b65d..221fdfd 100644 --- a/main.go +++ b/main.go @@ -26,7 +26,7 @@ var notHTTPS bool var simpleProgress bool func main() { - displayVersion = fmt.Sprintf("fast-cli %s-%s - built %s", version, commit, date) + displayVersion = fmt.Sprintf("%s-%s (built %s)", version, commit, date) app := &cli.App{ Name: "fast-cli", Usage: "Estimates your current internet download speed", @@ -76,11 +76,6 @@ func initLog() { func run(c *cli.Context) error { initLog() - if c.Bool("version") { - fmt.Println(displayVersion) - return nil - } - count := uint64(3) fast.UseHTTPS = !notHTTPS urls := fast.GetDlUrls(count)