Skip to content

feat: support variables and expansion in config file paths - #17

Merged
utahcon merged 1 commit into
mainfrom
feat/config-vars
Oct 8, 2026
Merged

utahcon merged 1 commit into
mainfrom
feat/config-vars

Conversation

@utahcon

@utahcon utahcon commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a top-level vars map to the config file; path values can reference $NAME / ${NAME}.
  • Variables resolve from vars first, then the environment; they can reference each other. Cycles and undefined variables are reported as errors.
  • Leading ~ expands to the home directory and the result is cleaned.
  • The config is never rewritten with expanded values (saving keeps the original text), and configHasOrg compares expanded paths.
  • configLookupOrg now expands paths and returns an error.
  • README updated.
vars:
  WORKSPACE: /my/path/here
  OTHERSPACE: /testing
orgs:
  - org: my-org
    path: $WORKSPACE/$OTHERSPACE   # -> /my/path/here/testing

Test plan

  • go build / go vet / gofmt
  • Manually verified expansion and the undefined-variable error with a temp config
  • Cycle detection and a real sync with a vars-based config

🤖 Generated with Claude Code

Add a top-level vars map to the config file. Paths may reference
$NAME or ${NAME}, resolved from vars first and then the environment,
with ~ expansion and cycle detection. The config is never rewritten
with expanded values.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@utahcon
utahcon merged commit 13cd392 into main Oct 8, 2026
4 checks passed
@utahcon
utahcon deleted the feat/config-vars branch October 8, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant