From a938917b9b3c77fa6a17bb01b583820f6a0a77b5 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Tue, 11 Feb 2020 14:14:34 -0500 Subject: [PATCH] Fetch tags if none are found --- assets/packaging/micro.1 | 4 ++-- tools/build-version.go | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/packaging/micro.1 b/assets/packaging/micro.1 index 184807be..811ba0d7 100644 --- a/assets/packaging/micro.1 +++ b/assets/packaging/micro.1 @@ -17,7 +17,7 @@ enjoyable to use full time, whether you work in the terminal because you prefer .SH OPTIONS .PP \-clean -.RS4 +.RS 4 Cleans the configuration directory .RE @@ -28,7 +28,7 @@ Specify a custom location for the configuration directory .RE .PP -\-[FILE]:LINE:COL +[FILE]:LINE:COL .RS 4 Specify a line and column to start the cursor at when opening a buffer .RE diff --git a/tools/build-version.go b/tools/build-version.go index ead81a43..45ebd2fc 100644 --- a/tools/build-version.go +++ b/tools/build-version.go @@ -15,6 +15,11 @@ func getTag(match ...string) (string, *semver.PRVersion) { if tag, err := exec.Command("git", args...).Output(); err != nil { return "", nil } else { + if len(tag) == 0 { + if _, err := exec.Command("git", "fetch", "tags").Output(); err != nil { + return "", nil + } + } tagParts := strings.Split(string(tag), "-") if len(tagParts) == 3 { if ahead, err := semver.NewPRVersion(tagParts[1]); err == nil {