Skip to content

Conversation

@amoeba
Copy link
Member

@amoeba amoeba commented Dec 12, 2025

Closes #230

@amoeba amoeba requested a review from zeroshade December 12, 2025 22:06
Comment on lines +13 to +22
userdir, err := os.UserConfigDir()
if err != nil {
return "", fmt.Errorf("failed to get dbc configuration directory: %v", err)
}

orgDirName := "columnar"
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
orgDirName = "Columnar"
}
dbcDirName := "dbc"
Copy link
Member

Choose a reason for hiding this comment

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

but you were the one who said I should use XDG_DATA_HOME if it exists.... lol

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh right. 🤦 This still fixes the original issue that was reported. Let me think about it and I'll tweak this so it uses XDG_DATA_DIR on Linuxes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Which would make this:

  • macOS + Windows: os.UserConfigDir()
  • Linux: check XDG_DATA_DIR, fallback to os.UserConfigDir()

Copy link
Member

Choose a reason for hiding this comment

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

it should be XDG_DATA_HOME, there is no XDG_DATA_DIR there is XDG_DATA_DIRS which is a list of paths

Copy link
Member

Choose a reason for hiding this comment

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

and we should still check XDG_DATA_HOME on macOS too. According to Apple's docs, the equivalent for XDG_DATA_HOME on macOS is ~/Library/

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, that last bit I didn't know.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe my idea was bad, I'll think about it more when I'm back.

Copy link
Member

Choose a reason for hiding this comment

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

yea, that's why it was using the logic I laid out. which was separate from the XDG_CONFIG_HOME (os.UserConfigDir) heh

@zeroshade
Copy link
Member

Did we come to a consensus on this?

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.

Rationalize locations where dbc configs are stored

2 participants