nixpkgs/pkgs/applications/audio/noisetorch/version.patch

38 lines
1.0 KiB
Diff
Raw Normal View History

2020-07-19 15:34:54 +00:00
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"))
}