docs: update README for alternative config path (#419)

This commit is contained in:
SteveLauC
2023-05-04 16:36:36 +08:00
committed by GitHub
parent a2331a2575
commit d640bc66f5

View File

@@ -55,10 +55,18 @@ See `config.example.toml` for an example configuration file.
### Configuration Path ### Configuration Path
The configuration should be placed in the following paths depending on the operating system: #### `CONFIG_DIR` on each platform
- **Windows**: `%APPDATA%`
- **macOS** and **other Unix systems**: `${XDG_CONFIG_HOME:-~/.config}`
- **Windows** - `%APPDATA%/topgrade.toml` `topgrade` will look for the configuration file in the following places, in order of priority:
- **macOS** and **other Unix systems** - `${XDG_CONFIG_HOME:-~/.config}/topgrade.toml`
1. `CONFIG_DIR/topgrade.toml`
2. `CONFIG_DIR/topgrade/topgrade.toml`
If the file with higher priority is present, no matter it is valid or not, the other configuration files will be ignored.
On the first run(no configuration file exists), `topgrade` will create a configuration file at `CONFIG_DIR/topgrade.toml` for you.
### Custom Commands ### Custom Commands