Skip to content

Commit

Permalink
don't trim leading slash on callers outside cwd (rs#266)
Browse files Browse the repository at this point in the history
Fixes rs#265
  • Loading branch information
jmcvetta authored Nov 2, 2020
1 parent 9336c4d commit cac3894
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions console.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ func consoleDefaultFormatCaller(noColor bool) Formatter {
if len(c) > 0 {
cwd, err := os.Getwd()
if err == nil {
c = strings.TrimPrefix(c, cwd)
c = strings.TrimPrefix(c, "/")
prefix := cwd + "/"
c = strings.TrimPrefix(c, prefix)
}
c = colorize(c, colorBold, noColor) + colorize(" >", colorCyan, noColor)
}
Expand Down

0 comments on commit cac3894

Please sign in to comment.