Skip to main content

Module config_dir

Module config_dir 

Source
Expand description

Config directory resolution for the waratah CLI (XDG conventions).

Configuration that outlives a single command invocation โ€” the cluster address table, the notebook service, a future licence file โ€” lives as named files in a config directory, decoupled from --data-dir (which holds state, not configuration). Lookups walk candidates in priority order and take the first file that exists:

  1. --config-dir PATH when given (exactly that directory, no fallback);
  2. the platform user config dir + waratah: Linux ${XDG_CONFIG_HOME:-~/.config}/waratah, macOS ~/Library/Application Support/waratah, Windows %APPDATA%\waratah (RoamingAppData, per the dirs crate convention);
  3. the platform system config dir + waratah: Linux /etc/waratah, macOS /Library/Application Support/waratah, Windows %PROGRAMDATA%\waratah (C:\ProgramData\waratah).

File names are fixed per consumer (cluster.toml, notebooks.toml); find is generic so later consumers (licence file, โ€ฆ) reuse it.

Modulesยง

files ๐Ÿ”’
Config file names owned by current consumers.

Enumsยง

Platform ๐Ÿ”’

Functionsยง

candidate_dirs ๐Ÿ”’
Directories to search for a config file, highest priority first.
find ๐Ÿ”’
First existing file_name in the config search path, if any.
platform ๐Ÿ”’
system_config_dir ๐Ÿ”’
system_config_dir_from ๐Ÿ”’
Pure core of system_config_dir.
user_config_dir_from ๐Ÿ”’
Pure core of [user_config_dir]: None inputs model unset env vars.