Skip to content

Commit

Permalink
Show relative path to rule that was used.
Browse files Browse the repository at this point in the history
  • Loading branch information
ejholmes committed Jan 15, 2017
1 parent c80e0e3 commit 11c4e90
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .walk/error
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

deps() {
echo test/000-cancel/fail
}

case $1 in
deps) deps ;;
esac
8 changes: 6 additions & 2 deletions plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,13 @@ type targetError struct {
}

func (e *targetError) Error() string {
prefix := fmt.Sprintf("error performing %s", e.target.Name())
prefix := e.target.Name()
if e.target.rulefile != "" {
prefix += fmt.Sprintf(" (using %s)", e.target.rulefile)
path := e.target.rulefile
if p, err := filepath.Rel(e.target.wd, path); err == nil {
path = p
}
prefix += fmt.Sprintf(" (executing %s)", path)
}
return fmt.Sprintf("%s: %v", prefix, e.err)
}
Expand Down

0 comments on commit 11c4e90

Please sign in to comment.