Skip to content

Commit

Permalink
Fix --version string and duplicate printing
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Oct 18, 2020
1 parent aee1bfd commit e9bf47b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
LAST_COMMIT := $(shell git rev-parse --short HEAD)
LAST_COMMIT_DATE := $(shell git show -s --format=%ci ${LAST_COMMIT})
VERSION := $(shell git describe --tags)
BUILDSTR := ${VERSION} (${LAST_COMMIT} $(shell date -u +"%Y-%m-%dT%H:%M:%S%z"))
VERSION := $(shell git describe --tags --abbrev=0)
BUILDSTR := ${VERSION} (\#${LAST_COMMIT} $(shell date -u +"%Y-%m-%dT%H:%M:%S%z"))

BIN := listmonk
STATIC := config.toml.sample \
Expand Down
3 changes: 2 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ var (
)

func init() {
lo.Println(buildString)
initFlags()

// Display version.
Expand All @@ -80,6 +79,8 @@ func init() {
os.Exit(0)
}

lo.Println(buildString)

// Generate new config.
if ko.Bool("new-config") {
if err := newConfigFile(); err != nil {
Expand Down
1 change: 0 additions & 1 deletion cmd/updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ var reSemver = regexp.MustCompile(`-(.*)`)
func checkUpdates(curVersion string, interval time.Duration, app *App) {
// Strip -* suffix.
curVersion = reSemver.ReplaceAllString(curVersion, "")

time.Sleep(time.Second * 1)
ticker := time.NewTicker(interval)
for ; true; <-ticker.C {
Expand Down

0 comments on commit e9bf47b

Please sign in to comment.