From b1c6e34fcbd79236587cc4c49c06a2c768a99be7 Mon Sep 17 00:00:00 2001 From: Edward McClanahan Date: Fri, 1 Mar 2024 15:11:08 -0800 Subject: [PATCH] Handle case where version is not knowable --- version/static-data/make_static_data.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/version/static-data/make_static_data.go b/version/static-data/make_static_data.go index 0cb9c96a..f44d523b 100644 --- a/version/static-data/make_static_data.go +++ b/version/static-data/make_static_data.go @@ -56,18 +56,18 @@ func main() { } _, err = dstFile.Write([]byte(fmt.Sprintf("package %v\n\n", packageName))) if nil != err { - panic(err.Error()) - } + gitDescribeCmd = exec.Command("git", "describe", "--tags") - gitDescribeCmd = exec.Command("git", "describe", "--tags") + gitDescribeOutput, err = gitDescribeCmd.Output() + if nil != err { + panic(err.Error()) + } - gitDescribeOutput, err = gitDescribeCmd.Output() - if nil != err { - panic(err.Error()) + proxyfsVersionString = string(gitDescribeOutput[:len(gitDescribeOutput)-1]) + } else { + proxyfsVersionString = "unknown" } - proxyfsVersionString = string(gitDescribeOutput[:len(gitDescribeOutput)-1]) - _, err = dstFile.Write([]byte(fmt.Sprintf("const ProxyFSVersion = `%v`\n", proxyfsVersionString))) if nil != err { panic(err.Error())