Skip to content

Commit

Permalink
Release 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoles1 committed Jul 15, 2018
2 parents 85a3273 + c504112 commit 43b8631
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GopherBadger
### Generate coverage badge images using Go!

![gopherbadger-tag-do-not-edit](https://img.shields.io/badge/Go%20Coverage-68%25-brightgreen.svg?longCache=true&style=flat)
<a href='https://github.com/jpoles1/gopherbadger' target='_blank'>![gopherbadger-tag-do-not-edit](https://img.shields.io/badge/Go%20Coverage-68%25-brightgreen.svg?longCache=true&style=flat)</a>

One day, I noticed that there was no easy way to generate coverage badges for my Golang projects. So I made one (see above)!

Expand Down
Binary file modified coverage_badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions coverbadge/coverbadge.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func (badge Badge) DownloadBadge(filepath string, coverageFloat float64) {
func (badge Badge) WriteBadgeToMd(filepath string, coverageFloat float64) {
badge.ImageExtension = ".svg"
badgeURL := badge.generateBadgeBadgeURL(coverageFloat)
newImageTag := fmt.Sprintf("![gopherbadger-tag-do-not-edit](%s)", badgeURL)
imageTagRegex := `\!\[gopherbadger-tag-do-not-edit\](.*)`
newImageTag := fmt.Sprintf("<a href='https://github.com/jpoles1/gopherbadger' target='_blank'>![gopherbadger-tag-do-not-edit](%s)</a>", badgeURL)
imageTagRegex := `(<a href=.*>)?\!\[gopherbadger-tag-do-not-edit\]\(.*\)(<\/a>)?`
r, err := regexp.Compile(imageTagRegex)
if err != nil {
logging.Fatal("Compiling regex: ", err)
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"flag"
"fmt"
"gopherbadger/coverbadge"
"gopherbadger/logging"
"github.com/jpoles1/gopherbadger/coverbadge"
"github.com/jpoles1/gopherbadger/logging"
"io"
"log"
"os"
Expand Down

0 comments on commit 43b8631

Please sign in to comment.