fix: Create doc directory if doesn't exist#220
Conversation
b4ed024 to
1061746
Compare
plugins/source_docs.go
Outdated
| // GenerateSourcePluginDocs creates table documentation for the source plugin based on its list of tables | ||
| func (p *SourcePlugin) GenerateSourcePluginDocs(dir string) error { | ||
| for _, table := range p.Tables() { | ||
| if err := os.MkdirAll(dir, os.ModePerm); err != nil { |
There was a problem hiding this comment.
I thinks this should be before the loop
There was a problem hiding this comment.
also, no need to print to stdout as it return an error anyway and it will print (otherwise it will be printed twice which will be confusing). same of the underlying line (I know not related to this PR)
There was a problem hiding this comment.
I thinks this should be before the loop
Good point, fixed in d6e2729. I think it has the downside of creating the directory even if there are no tables, but I don't think that's a concern we should be dealing with.
There was a problem hiding this comment.
also, no need to print to stdout as it return an error anyway and it will print (otherwise it will be printed twice which will be confusing). same of the underlying line (I know not related to this PR)
Fixed in #226
#### Summary <!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 --> Extracted from #220
🤖 I have created a release *beep* *boop* --- ## [0.11.5](v0.11.4...v0.11.5) (2022-10-03) ### Bug Fixes * Create doc directory if doesn't exist ([#220](#220)) ([067534d](067534d)) * **deps:** Update golang.org/x/exp digest to 540bb73 ([#212](#212)) ([2e3dae3](2e3dae3)) * **deps:** Update golang.org/x/sync digest to 8fcdb60 ([#213](#213)) ([7d7d85f](7d7d85f)) * Remove redundant error print ([#226](#226)) ([9927ede](9927ede)) * Remove unused docs template function ([#221](#221)) ([f65f023](f65f023)) * Use correct path for Windows zip ([#223](#223)) ([960f650](960f650)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Summary
If you run the
doccommand and the output directory doesn't exist, the command will fail. This fixes itUse the following steps to ensure your PR is ready to be reviewed
go fmtto format your code 🖊golangci-lint run🚨 (install golangci-lint here)