Closed rubiojr closed 4 years ago
Forgot to mention that, as an additional benefit, this would open the door to have a dedicated config directory where we can store other things, like hive specific data.
I agree, I think it makes sense to follow the XDG specs here. A while ago I've actually written a little Go library that retrieves platform specific paths: https://github.com/muesli/go-app-paths/ - may come in handy here.
Beehive tries to load a
beehive.conf
from the current directory./beehive.conf
when booting (if found). If not found, it'll use an in-memory representation until the process exits cleanly, then write it to the current directory.The proposal is to also search for a config using
$os.UserConfigDir/beehive/beehive.conf
, so~/.config/beehive/beehive.conf
under Linux for example (platform dependent).With this change, Beehive would search for the config file in this particular order:
$os.UserConfigDir/beehive/beehive.conf
The change would be backwards compatible.
I also thought about writing to
$os.UserConfigDir/beehive
instead of$CWD
when there's no config present, which sounds harmless for the most part, but that'd change behavior in a backwards incompatible way.Thoughts?