mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +00:00
38 lines
1.0 KiB
Diff
38 lines
1.0 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"))
|
||
|
}
|