Skip to content

Commit

Permalink
if file doesn't exist don't try to replace workdir
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Nayak <[email protected]>
  • Loading branch information
rohit-nayak-ps committed Dec 15, 2024
1 parent 11894f3 commit c42498d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions go/cmd/internal/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ func restructure(rootDir string, dir string, name string, commands []*cobra.Comm
continue
}
f := filepath.Join(dir, fullCmdFilename+".md")
if _, err := os.Stat(f); err != nil {
if errors.Is(err, fs.ErrNotExist) {
continue
}
return fmt.Errorf("failed to get file info for %s: %w", f, err)
}
if err := anonymizeHomedir(f); err != nil {
return fmt.Errorf("failed to anonymize homedir in help text for command %s: %w", f, err)
}
Expand Down

0 comments on commit c42498d

Please sign in to comment.