Skip to content

Allow overriding config dir with BUTLER_CONFIG_DIR env var#12611

Draft
mtsgrd wants to merge 1 commit intomasterfrom
butler-config-dir-env
Draft

Allow overriding config dir with BUTLER_CONFIG_DIR env var#12611
mtsgrd wants to merge 1 commit intomasterfrom
butler-config-dir-env

Conversation

@mtsgrd
Copy link
Contributor

@mtsgrd mtsgrd commented Feb 26, 2026

Check the BUTLER_CONFIG_DIR environment variable before falling back to
the platform config directory. This allows callers to explicitly
override the config location for gitbutler.

Check the BUTLER_CONFIG_DIR environment variable before falling back to
the platform config directory. This allows callers to explicitly
override the config location for gitbutler.
Copilot AI review requested due to automatic review settings February 26, 2026 12:16
@vercel
Copy link

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Ignored Ignored Preview Feb 26, 2026 0:16am

Request Review

@github-actions github-actions bot added the rust Pull requests that update Rust code label Feb 26, 2026
@mtsgrd mtsgrd requested a review from Byron February 26, 2026 12:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an environment-variable override to control where GitButler reads/writes its shared configuration directory, improving flexibility for callers (e.g., CI, packaging, custom installs) before falling back to the OS platform default.

Changes:

  • Check BUTLER_CONFIG_DIR in app_config_dir() and use it when set.
  • Preserve existing E2E_TEST_APP_DATA_DIR override behavior and platform fallback behavior.

@mtsgrd mtsgrd marked this pull request as draft February 26, 2026 12:23
@mtsgrd
Copy link
Contributor Author

mtsgrd commented Feb 26, 2026

@Byron this is a change I've had in my workspace for a while, mainly so I can run two dev instances with different configs. Do you have any immediate opinion on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants