Closed sindresorhus closed 11 years ago
I could not find any program that relies on configuration options stored in the user directory and does not complain about HOME being unset:
$ git config --global --list
fatal: $HOME not set
$ tig
tig: Failed to load user config.
I think configstore should just pretend that no config is available. Saving is tricky, though. I don't think it should fail silently.
Interesting side note: You cannot unset or modify HOME in fish. <3
Interesting side note: You cannot unset or modify HOME in fish. <3
The best solutions are those that prevent you from doing stupid things <3
I'm curious if there is any plan to address this issue, one way or the other. Can someone set expectations appropriately? Thanks.
Yes, I'm working on a fix.
I think that any user that uses configstore
can't really trust that the value will be persistent forever, since the user can just delete the .config/configstore
folder. Code must adapt to that fact.
Having this said, I think that using tmp
is a viable option since the value will be persistent but by an undetermined duration. I've implemented #7 with this strategy.
Related: https://github.com/bower/bower/issues/525#issuecomment-21808076
@sindresorhus Needs to be improved. I think we must append the username to the tmp
folder, so that multiple users do not use the same folder (causing EACCESS/EPERM issues).
We can use osenv
module from isaacs to get the username.
There are of course environments where $HOME is not set: https://github.com/bower/bower/issues/558
Is there any way we can gracefully fallback to something else? Maybe a hidden local folder? (it needs to be persistent, so can't use /tmp).
@satazor @passy @stephenplusplus