0eaa97ffad
GitOrigin-RevId: c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38
37 lines
1 KiB
Diff
37 lines
1 KiB
Diff
diff --git a/scripts/embedversion.go b/scripts/embedversion.go
|
|
index ce0a756..60e7a5e 100644
|
|
--- a/scripts/embedversion.go
|
|
+++ b/scripts/embedversion.go
|
|
@@ -1,24 +1,18 @@
|
|
package main
|
|
|
|
import (
|
|
- "os"
|
|
- "os/exec"
|
|
- "strings"
|
|
+ "os"
|
|
+ "strings"
|
|
)
|
|
|
|
func main() {
|
|
- cmd := exec.Command("git", "describe", "--tags")
|
|
- ret, err := cmd.Output()
|
|
|
|
- if err != nil {
|
|
- panic("Couldn't read git tags to embed version number")
|
|
- }
|
|
- version := strings.TrimSpace(string(ret))
|
|
+ version := strings.TrimSpace(string(os.Getenv("version")))
|
|
|
|
- out, _ := os.Create("version.go")
|
|
- defer out.Close()
|
|
+ out, _ := os.Create("version.go")
|
|
+ defer out.Close()
|
|
|
|
- out.Write([]byte("package main\n\n//THIS FILE IS AUTOMATICALLY GENERATED BY `go generate` DO NOT EDIT!\n\nvar version=\""))
|
|
- out.Write([]byte(version))
|
|
- out.Write([]byte("\"\n"))
|
|
+ out.Write([]byte("package main\n\n//THIS FILE IS AUTOMATICALLY GENERATED BY `go generate` DO NOT EDIT!\n\nvar version=\""))
|
|
+ out.Write([]byte(version))
|
|
+ out.Write([]byte("\"\n"))
|
|
}
|