Expand the doc comment of config_dir.

pull/13893/head
Delyan Angelov 2022-04-01 19:42:20 +03:00 committed by GitHub
parent f4e54423c9
commit 29125f221a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -767,7 +767,12 @@ pub fn quoted_path(path string) string {
}
}
// returns the path to the user configuration directory or error in case the environment is missing
// config_dir returns the path to the user configuration directory (depending on the platform).
// On windows, that is `%AppData%`.
// On macos, that is `~/Library/Application Support`.
// On the rest, that is `$XDG_CONFIG_HOME`, or if that is not available, `~/.config`.
// If the path cannot be determined, it returns an error.
// (for example, when $HOME on linux, or %AppData% on windows is not defined)
pub fn config_dir() ?string {
$if windows {
app_data := getenv('AppData')