Skip to content

Conversation

timothy-mcroy
Copy link

Description of your changes

Checks if there was any file writing error before sending a success message.

Fixes #724

I have:

  • Read and followed terraform-docs' [contribution process].
  • All tests pass when I run make test.

How has this code been tested

vscode ➜ /workspaces/terraform-docs (skipMisleadingSuccessMessage) $ make build && ./bin/linux-amd64/terraform-docs markdown table --output-file test-README.md ./examples/
==> Clean workspace
rm -rf ./bin ./coverage.out
==> Build binary for current OS/ARCH
CGO_ENABLED=0 go build -ldflags="-X github.com/terraform-docs/terraform-docs/internal/version.commit=1d4c250" -o ./bin/linux-amd64/terraform-docs
examples/test-README.md updated successfully
vscode ➜ /workspaces/terraform-docs (skipMisleadingSuccessMessage) $ chmod -w ./examples/test-README.md 
vscode ➜ /workspaces/terraform-docs (skipMisleadingSuccessMessage) $ ./bin/linux-amd64/terraform-docs markdown table --output-file test-README.md ./examples/
Error: open examples/test-README.md: permission denied
vscode ➜ /workspaces/terraform-docs (skipMisleadingSuccessMessage) $ 

Signed-off-by: Tim McRoy <tim.mcroy45@gmail.com>
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.

False reports that an output file was updated successfully when the file write failed
1 participant