You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was confused by how ocm-cli selects its config files (and documents other behavior) and dug around a little :
How ocm-cli selects a config file path
Because config.Location()initially defaults to ~/.ocm.json but then stats the file to see if it exists and when it does not, the location is then actually defaulted to ~/.config/ocm/ocm.json (or wherever the user config folder on your system lives).
The config location is selected in this order:
checking $OCM_CONFIG. If not empty it will be the config location.
checking ~/.ocm.json. If a file exists there it will the the config location.
falling back to $XDG_CONFIG_HOME/ocm/ocm.json (XDG_CONFIG_HOME is ~/.config by default)
I think the description for ocm config should be updated to properly reflect this behavior. ocm config --help currently states
The location of the configuration file is gleaned from the 'OCM_CONFIG' environment variable,
or ~/.ocm.json if that variable is unset. Currently using: /home/erdii/.config/ocm/ocm.json
Which is not the complete truth.
The text was updated successfully, but these errors were encountered:
erdii
changed the title
config loading behavior
Explain config loading behavior in help text
Aug 22, 2023
Hey :)
I was confused by how ocm-cli selects its config files (and documents other behavior) and dug around a little :
How ocm-cli selects a config file path
Because
config.Location()
initially defaults to~/.ocm.json
but then stats the file to see if it exists and when it does not, the location is then actually defaulted to~/.config/ocm/ocm.json
(or wherever the user config folder on your system lives).The config location is selected in this order:
$OCM_CONFIG
. If not empty it will be the config location.~/.ocm.json
. If a file exists there it will the the config location.$XDG_CONFIG_HOME/ocm/ocm.json
(XDG_CONFIG_HOME
is~/.config
by default)I think the description for
ocm config
should be updated to properly reflect this behavior.ocm config --help
currently statesWhich is not the complete truth.
The text was updated successfully, but these errors were encountered: