diff --git a/config/scanner.go b/config/scanner.go index 798aaf5..8955995 100644 --- a/config/scanner.go +++ b/config/scanner.go @@ -63,6 +63,23 @@ func (s *scanner) scanDirectory(directory string) error { for _, fi := range fi { pathName := path.Clean(directory + "/" + fi.Name()) + if fi.Mode() & os.ModeSymlink == os.ModeSymlink { + linkpath, err := os.Readlink(directory + "/" + fi.Name()) + if err != nil { + return err + } + fullPath := "" + if filepath.IsAbs(linkpath) { + fullPath = linkpath + } else { + fullPath = directory + "/" + linkpath + } + fi, err = os.Lstat(fullPath) + if err != nil { + return err + } + } + // regular file if fi.Mode().IsRegular() { if !s.shouldProcess(pathName) {