click_config_file icon indicating copy to clipboard operation
click_config_file copied to clipboard

Feature Request: Ability to set the implicit folder

Open gsemet opened this issue 3 years ago • 2 comments

Hello

Currently, click_config_file uses get_app_dir to find the config file. I would like a way to look either in current folder or on the $HOME folder, for instance (like "#HOME/.myapprc"), or maybe a combination of one or several PATH to look in.

Thanks

gsemet avatar Sep 10 '21 15:09 gsemet

Seems like you want an explicit location for the configuration file instead of an implicit one.

You can set any default path you like by setting a parameter:

@configuration_option(default='/some/dir')

It accepts callables as well:

@configuration_option(default=lambda: a if exists(a) else b)

phha avatar Sep 27 '21 18:09 phha

Came across this as well when going through the example from the README. A common pattern is to first look in the current working directory and then through XDG_CONFIG_DIRS.

dirks avatar Jan 17 '23 17:01 dirks