Tracker: Set defaults for all options using a config file #176
Open
Description
If a user has a magically named config file in the current working directory (e.g. web-ext-config.json
) then web-ext
should use this to set default option values (and web-ext should log a message about using it). Here are a few other examples of how it should work:
The config can also be specified explicitly:
web-ext --config=/path/to/web-ext-config.json build ...
The config file should apply to global option values as well as sub-command option values. Here is an example of a config that is the equivalent of web-ext --verbose sign --api-url-prefix https://addons-dev.allizom.org/api/v3
:
{
"verbose": true,
"sign": {
"api-url-prefix": "https://addons-dev.allizom.org/api/v3"
}
}
The camel case variants of each option should also be supported, such as:
{
"sign": {
"apiUrlPrefix": "https://addons-dev.allizom.org/api/v3"
}
}
Some additional rules:
- A command line option will take precedence over any config value
- An environment variable will take precedence over any config value
- A config can exist as
~/.web-ext-config.json
as well as./web-ext-config.json
(these would override each other in the order listed here).