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

Create config file/directory if it doesn't exist. #141

Open
1 task done
SelfhostedPro opened this issue Mar 2, 2024 · 2 comments
Open
1 task done

Create config file/directory if it doesn't exist. #141

SelfhostedPro opened this issue Mar 2, 2024 · 2 comments

Comments

@SelfhostedPro
Copy link

Describe the feature

It would be really nice to add an option like create: true to write whatever the default is to the config file/directory. I can definitely make a PR if needed.

Additional information

  • Would you be willing to help implement this feature?
@pi0
Copy link
Member

pi0 commented Mar 3, 2024

It is a nice idea but the most tricky thing is that the default config template, is rally up to the consumer of c12, also the filename and I imagine this might be better handled in upper layers.

Do you care to explain more of your usecase for this feature?

@SelfhostedPro
Copy link
Author

Sure, I don't want a user to have to write a default config (most of my users will have an interest in technology but may not want to/know how to write yaml).

I'm providing a UI to be able to change these settings so the users don't have to. I wound up just writing my own logic for it in the meantime but it may be beneficial to have it as an option so I don't need to.

https://github.com/SelfhostedPro/yacht-nuxt/blob/main/modules/config/runtime/server/utils/config.ts

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