Skip to content

Commit

Permalink
Don't panic if we hit a dangling symlink in mungedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
thockin committed Jul 13, 2016
1 parent 2906a35 commit a8d394b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/mungedocs/mungedocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ func (f fileProcessor) visit(path string) error {
func newWalkFunc(fp *fileProcessor, changesNeeded *bool) filepath.WalkFunc {
return func(path string, info os.FileInfo, err error) error {
stat, err := os.Stat(path)
if err != nil {
if os.IsNotExist(err) {
return nil
}
return err
}
if path != *rootDir && stat.IsDir() && *norecurse {
return filepath.SkipDir
}
Expand Down

0 comments on commit a8d394b

Please sign in to comment.