Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Commit

Permalink
Output the relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
diegobernardes committed May 19, 2020
1 parent 8d578ad commit b989998
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"os"
"sort"
"strings"

"github.com/logrusorgru/aurora"

Expand Down Expand Up @@ -129,7 +130,7 @@ func (c Client) output(entries []service.Entry) bool {
result = true
}

fmt.Print(aurora.Bold(key))
fmt.Print(aurora.Bold(c.relativePath(key)))
for _, entry := range entries {
if entry.Valid {
continue
Expand Down Expand Up @@ -178,6 +179,10 @@ func (Client) hasInvalidLink(entries []service.Entry) bool {
return false
}

func (c Client) relativePath(path string) string {
return strings.Replace(path, c.Path, "", -1)
}

type serviceEntrySort []service.Entry

func (s serviceEntrySort) Len() int {
Expand Down

0 comments on commit b989998

Please sign in to comment.