Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

look for Brewfile in HOMEBREW_USER_CONFIG_HOME #1549

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rrotter
Copy link
Contributor

@rrotter rrotter commented Jan 2, 2025

Indirectly support XDG_CONFIG_HOME by leaning on brew's support for it.

when --global is set, we'll get the brewfile from:

  • $HOMEBREW_BUNDLE_FILE_GLOBAL if set
  • $XDG_CONFIG_HOME/homebrew/Brewfile (if XDG_CONFIG_HOME is set and file exists)
  • $HOME/.homebrew/Brewfile (if XDG_CONFIG_HOME is not set, and file exists)
  • ~/.Brewfile (unconditional fallback, but if this doesn't exist either, we should probably use $HOMEBREW_USER_CONFIG_HOME/Brewfile as the new default)

Starting this as a draft because:

When --global is set, use `$HOMEBREW_USER_CONFIG_HOME/Brewfile` if
it exists before falling back to `~/.Brewfile`.
@MikeMcQuaid
Copy link
Member

  • $HOME/.homebrew/Brewfile (if XDG_CONFIG_HOME is not set, and file exists)
  • but if this doesn't exist either, we should probably use $HOMEBREW_USER_CONFIG_HOME/Brewfile as the new default

This is the only part I'm 👎🏻 on, I don't see any users wanting this.

  • looking for feedback on what the fallback default should be if no file exists

The current location.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Code mostly makes sense so far. I'd be 👍🏻 on supporting behaviour change if XDG_CONFIG_HOME is set and otherwise I'd like to leave everything as-is. Thanks!

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.

2 participants