Skip to content
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

[Feature request] Create folder when using the output parameter #35

Closed
michaelmass opened this issue May 10, 2021 · 2 comments
Closed

Comments

@michaelmass
Copy link
Contributor

When using the parameter -output with a template like doc/{{.Dir}}/README.md, the cli returns an error if the folder doesn't exist.

failed to write output file doc\pkg\foo\README.md: open doc\pkg\foo\README.md: The system cannot find the path specified.

Maybe the cli should automatically create the folder or it could be a new flag -create-dirs.

I have already made a fork for it. If it is accepted, I will open a PR:
https://github.com/michaelmass/gomarkdoc/commit/b868c0fc4a6a07512eaf94f072f4325ba6efc709

@princjef
Copy link
Owner

Yeah that's a reasonable addition. It seems simpler to me to have it be the default behavior rather than a flag, unless you know of use cases where people wouldn't want that behavior.

I took a quick look at your change. Feel free to open a PR and we can get this merged/published.

@princjef
Copy link
Owner

Closed by #36

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

No branches or pull requests

2 participants