Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
6bf4edad
Commit
6bf4edad
authored
Mar 04, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated build.go to get better version/build names
parent
de1e7625
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
build.go
+20
-14
No files found.
build.go
View file @
6bf4edad
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment