MCPcopy Create free account
hub / github.com/cli/cli / version

Function version

script/build.go:151–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149}
150
151func version() string {
152 if versionEnv := os.Getenv("GH_VERSION"); versionEnv != "" {
153 return versionEnv
154 }
155 if desc, err := cmdOutput("git", "describe", "--tags"); err == nil {
156 return desc
157 }
158 rev, _ := cmdOutput("git", "rev-parse", "--short", "HEAD")
159 return rev
160}
161
162func date() string {
163 t := time.Now()

Callers 2

build.goFile · 0.85
TestViewRunFunction · 0.85

Calls 1

cmdOutputFunction · 0.85

Tested by 1

TestViewRunFunction · 0.68