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

no default for config.Pkg when using --config #32

Closed
asphaltbuffet opened this issue Jun 6, 2024 · 1 comment · Fixed by #33
Closed

no default for config.Pkg when using --config #32

asphaltbuffet opened this issue Jun 6, 2024 · 1 comment · Fixed by #33
Assignees

Comments

@asphaltbuffet
Copy link

The example config documentation claims that the default for pkg: is slogx:

# the name for the generated package.
# default: slogx
pkg: example

However, that only gets set to default when not using a config file, as the default is part of the pkg flag. There should be a check in the constructor for a new config object that adds something there (instead of in the flag or in addition to the flag value).

There are no tests for reading a config file for pkg: ""

As a result, when creating the package, the call to os.Mkdir(cfg.Pkg, 0o755) fails with an unhelpful message passed to user:

❯ go run go-simpler.org/sloggen@latest -config ./.sloggen.yml
mkdir : no such file or directory
exit status 1
@tmzane tmzane self-assigned this Jun 8, 2024
@tmzane tmzane closed this as completed in #33 Jun 8, 2024
@tmzane
Copy link
Member

tmzane commented Jun 8, 2024

Thanks for the report, fixed in #33.

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

Successfully merging a pull request may close this issue.

2 participants