mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Don't panic if we hit a dangling symlink in mungedocs
This commit is contained in:
parent
2906a35c1a
commit
a8d394bfd4
@ -158,6 +158,12 @@ func (f fileProcessor) visit(path string) error {
|
|||||||
func newWalkFunc(fp *fileProcessor, changesNeeded *bool) filepath.WalkFunc {
|
func newWalkFunc(fp *fileProcessor, changesNeeded *bool) filepath.WalkFunc {
|
||||||
return func(path string, info os.FileInfo, err error) error {
|
return func(path string, info os.FileInfo, err error) error {
|
||||||
stat, err := os.Stat(path)
|
stat, err := os.Stat(path)
|
||||||
|
if err != nil {
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
if path != *rootDir && stat.IsDir() && *norecurse {
|
if path != *rootDir && stat.IsDir() && *norecurse {
|
||||||
return filepath.SkipDir
|
return filepath.SkipDir
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user