mirror of
https://github.com/goreleaser/goreleaser.git
synced 2026-06-19 23:24:39 +02:00
fixed tag and shit
This commit is contained in:
2 files changed
+11
-2
No files matched your search
+3
-1
@@ -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))
|
||||
|
||||
+8
-1
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user