Guava.Config (Guava v0.34.0)

Copy Markdown View Source

Resolves the Guava base URL and locates the CLI config file.

Mirrors guava.utils.get_base_url / cli_config_path.

Summary

Functions

Resolve the base URL.

Path to the CLI config file ($config/guava/config.json).

The default Guava base URL.

Platform config directory, mirroring Rust dirs::config_dir(): $APPDATA on Windows, ~/Library/Application Support on macOS, else $XDG_CONFIG_HOME or ~/.config.

Read and parse the CLI config, or nil if it does not exist / is invalid.

Functions

base_url()

@spec base_url() :: String.t()

Resolve the base URL.

Precedence: config :guava, base_url: ..., then the GUAVA_BASE_URL env var, then a base_url in the CLI config, then the default.

cli_config_path()

@spec cli_config_path() :: Path.t()

Path to the CLI config file ($config/guava/config.json).

default_base_url()

@spec default_base_url() :: String.t()

The default Guava base URL.

platform_config_dir()

@spec platform_config_dir() :: Path.t()

Platform config directory, mirroring Rust dirs::config_dir(): $APPDATA on Windows, ~/Library/Application Support on macOS, else $XDG_CONFIG_HOME or ~/.config.

read_cli_config()

@spec read_cli_config() :: map() | nil

Read and parse the CLI config, or nil if it does not exist / is invalid.