Documentation
¶
Overview ¶
Package config reads and writes ~/.ccl/config.yaml.
Load is read-only: it applies the current migrations in memory so every caller sees normalized values, but never writes. Migrate persists those migrations once per process. Every change goes through Update, which holds an exclusive file lock across re-read → change → atomic write, so a long-running command (ccl set, an OAuth login) cannot overwrite what another ccl process changed in the meantime.
Index ¶
Constants ¶
const CurrentVersion = 2
CurrentVersion is the config schema this ccl writes. Migrations that are not idempotent with respect to user intent run only for older files.
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
func ConfigPath() string
func Load ¶
Load reads the config and normalizes it in memory. It never writes; a missing file yields an empty config. A pre-rename ~/.cc/config.yaml is read in place until Migrate moves it.
func Migrate ¶ added in v1.5.18
func Migrate() error
Migrate persists the migrations Load applies in memory, and moves a pre-rename ~/.cc/config.yaml into ~/.ccl. It runs once at startup.
func Save ¶
Save replaces the whole config. Prefer Update, which cannot lose a change another process made since cfg was loaded.
Types ¶
This section is empty.