From d640bc66f5861e72cb45d9bb9c69a984ba7fe21b Mon Sep 17 00:00:00 2001 From: SteveLauC Date: Thu, 4 May 2023 16:36:36 +0800 Subject: [PATCH] docs: update README for alternative config path (#419) --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f0a42019..8347a78e 100644 --- a/README.md +++ b/README.md @@ -55,10 +55,18 @@ See `config.example.toml` for an example configuration file. ### 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` -- **macOS** and **other Unix systems** - `${XDG_CONFIG_HOME:-~/.config}/topgrade.toml` +`topgrade` will look for the configuration file in the following places, in order of priority: + +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