Commit 6bf4edad by Torkel Ödegaard

Updated build.go to get better version/build names

parent de1e7625
......@@ -5,7 +5,6 @@ package main
import (
"bytes"
"crypto/md5"
"encoding/json"
"flag"
"fmt"
"io"
......@@ -70,6 +69,7 @@ func main() {
case "test":
test("./pkg/...")
grunt("test")
case "latest":
version += "-" + getGitSha()
......@@ -89,21 +89,27 @@ func main() {
}
func readVersionFromPackageJson() {
reader, err := os.Open("package.json")
v, err := runError("git", "describe", "--tags", "--dirty")
if err != nil {
log.Fatal("Failed to open package.json")
return
return "unknown-ver"
}
defer reader.Close()
jsonObj := map[string]interface{}{}
jsonParser := json.NewDecoder(reader)
if err := jsonParser.Decode(&jsonObj); err != nil {
log.Fatal("Failed to decode package.json")
}
version = jsonObj["version"].(string)
version = v
// reader, err := os.Open("package.json")
// if err != nil {
// log.Fatal("Failed to open package.json")
// return
// }
// defer reader.Close()
//
// jsonObj := map[string]interface{}{}
// jsonParser := json.NewDecoder(reader)
//
// if err := jsonParser.Decode(&jsonObj); err != nil {
// log.Fatal("Failed to decode package.json")
// }
//
// version = jsonObj["version"].(string)
}
func createRpmAndDeb() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment