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

Lazy directory / file create #56

Closed
Jason3S opened this issue Jul 21, 2017 · 5 comments
Closed

Lazy directory / file create #56

Jason3S opened this issue Jul 21, 2017 · 5 comments

Comments

@Jason3S
Copy link
Contributor

Jason3S commented Jul 21, 2017

I noticed that configstore creates the directory and file on read.

Would you be interested in adding an option that allowed for file creation at write time if it doesn't exist?

I had some user complaining about files being written when they hadn't made any changes.

@sindresorhus
Copy link
Owner

I had some user complaining about files being written when they hadn't made any changes.

How would they even notice? It's not written in a location users usually look at. And why is it a problem? You're going to write to that directory at some point regardless. I'm just trying to understand your use-case.

@Jason3S
Copy link
Contributor Author

Jason3S commented Jul 21, 2017

Our use case is a bit different. If the global setting exists, then read it and merge it with the local settings. Related Issue is about how the file was written when it wasn't ask for.

I can do a pull request if this helps.

The idea is to add a "lazy" option and only create on write.

@sindresorhus
Copy link
Owner

Not really interested in an option for this obscure use-case, but I guess we could remove https://github.com/yeoman/configstore/blob/35d46bb6a37a17d5ff69896b13ea7c322728e54f/index.js#L33 as it seems moot since we already create the directory on write.

@Jason3S
Copy link
Contributor Author

Jason3S commented Jul 21, 2017

Excellent!! That works perfectly!

@kevva
Copy link
Contributor

kevva commented Jul 21, 2017

@Jason3S, PR welcome :).

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

3 participants