MCPcopy
hub / github.com/perkeep/perkeep / getVersion

Function getVersion

make.go:248–258  ·  view source on GitHub ↗

getVersion returns the version of Perkeep found in a VERSION file at the root.

()

Source from the content-addressed store, hash-verified

246
247// getVersion returns the version of Perkeep found in a VERSION file at the root.
248func getVersion() string {
249 slurp, err := os.ReadFile(filepath.Join(pkRoot, "VERSION"))
250 v := strings.TrimSpace(string(slurp))
251 if err != nil && !os.IsNotExist(err) {
252 log.Fatal(err)
253 }
254 if v == "" {
255 return "unknown"
256 }
257 return v
258}
259
260var gitVersionRx = regexp.MustCompile(`\b\d\d\d\d-\d\d-\d\d-[0-9a-f]{10,10}\b`)
261

Callers 1

mainFunction · 0.70

Calls 1

FatalMethod · 0.80

Tested by

no test coverage detected