mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
fixed tag and shit
This commit is contained in:
parent
b99db9dd97
commit
6880f3b86b
@ -21,8 +21,10 @@ func getTag(ref string) (tag string, err error) {
|
||||
"--tags",
|
||||
"--abbrev=0",
|
||||
"--always",
|
||||
ref,
|
||||
)
|
||||
if ref != "" {
|
||||
cmd.Args = append(cmd.Args, ref)
|
||||
}
|
||||
bts, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return tag, errors.New(err.Error() + ": " + string(bts))
|
||||
|
@ -17,4 +17,11 @@ func TestPreviousTag(t *testing.T) {
|
||||
tag, err := PreviousTag("v0.0.1")
|
||||
assert.NoError(err)
|
||||
assert.NotEmpty(tag)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInvalidRef(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
tag, err := PreviousTag("this-should-not-exist")
|
||||
assert.Error(err)
|
||||
assert.Empty(tag)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user