[Request] Portable configuration
Is your feature request related to a problem? Please describe.
Portable configuration and database
Describe the solution you'd like
ytcc should look for a config file in the same directory as the executable and prioritize it over the other configs. When this "portable" config file is detected, the default db path, download path etc should also be set relative to the executable's path.
I can make a PR for this if needed
What's the usecase? You can override the config lookup path by setting the YTCC_CONFIG env variable or passing ytcc the --conf option.
You can override the config lookup path by setting the
YTCC_CONFIGenv variable or passing ytcc the--confoption.
That is what I am doing now. Since I want don't want to pass --conf each time, I had to create a wrapper script that calls ytcc --conf ... and also explicitly define relative paths for download, db etc.
Built-in support for a portable config would make this much easier. But if you think the current option is good enough, feel free to close the issue
I don't see why we need to change anything in ytcc, because you can emulate a portable config with
export YTCC_CONFIG=.ytcc.conf
If .ytcc.conf does not exist in the current working directory, configuration is read from the usual places. Additionally, you can create "incomplete" config files that override only the settings you want to change for a certain directory.
In your case following might help:
- Instead of writing a wrapper,
export YTCC_CONFIG=.ytcc.confin your shellrc or similar. - In directories where you want to override some ytcc settings create configs that override the defaults. E.g.
[ytcc] download_dir = downloads db_path = ytcc.db