summaryrefslogtreecommitdiffstats
path: root/common/herrors/error_locator.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/herrors/error_locator.go')
-rw-r--r--common/herrors/error_locator.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/herrors/error_locator.go b/common/herrors/error_locator.go
index 3f1aae689..cb59b65a3 100644
--- a/common/herrors/error_locator.go
+++ b/common/herrors/error_locator.go
@@ -18,8 +18,10 @@ import (
"fmt"
"io"
"io/ioutil"
+ "os"
"strings"
+ "github.com/gohugoio/hugo/common/terminal"
"github.com/gohugoio/hugo/helpers"
"github.com/spf13/afero"
@@ -27,6 +29,12 @@ import (
var fileErrorFormat = "\"%s:%d:%d\": %s"
+func init() {
+ if terminal.IsTerminal(os.Stdout) {
+ fileErrorFormat = terminal.Notice("\"%s:%d:%d\"") + ": %s"
+ }
+}
+
// LineMatcher contains the elements used to match an error to a line
type LineMatcher struct {
FileError FileError