Skip to content

Fixed --recursive flag behaviour #655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from

Conversation

alexyz79
Copy link

Description of your changes

Changed the behaviour of 'findSubmodules' in 'internal/cli/run.go', by returning an empty module list if the folder is not found, this will allow the normal execution of terraform-docs using '--recursive' even if the 'modules' folder is not available. It fixes when the recursive flag is used on a project without a "modules" folder.

It only returns an empty list if 'err' is a 'NotExist' error, other wise it keeps the same behaviour: returns the error code.

Fixes #654

I have:

How has this code been tested

Tested in terraform projects with and without "modules" folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flag "--recursive" fails if "modules" folder does not exists
1 participant