Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
20899c05
Commit
20899c05
authored
Nov 27, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal/build: use 'git tag --points-at' to get the current tag
This should restore support for building with git 1.x.
parent
4c8c5e2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
env.go
internal/build/env.go
+6
-1
No files found.
internal/build/env.go
View file @
20899c05
...
...
@@ -20,6 +20,7 @@ import (
"flag"
"fmt"
"os"
"strings"
)
var
(
...
...
@@ -89,11 +90,15 @@ func LocalEnv() Environment {
}
}
if
env
.
Tag
==
""
{
env
.
Tag
=
RunGit
(
"for-each-ref"
,
"--points-at=HEAD"
,
"--count=1"
,
"--format=%(refname:short)"
,
"refs/tags"
)
env
.
Tag
=
firstLine
(
RunGit
(
"tag"
,
"-l"
,
"--points-at"
,
"HEAD"
)
)
}
return
env
}
func
firstLine
(
s
string
)
string
{
return
strings
.
Split
(
s
,
"
\n
"
)[
0
]
}
func
applyEnvFlags
(
env
Environment
)
Environment
{
if
!
flag
.
Parsed
()
{
panic
(
"you need to call flag.Parse before Env or LocalEnv"
)
...
...
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