Skip to content

fix: Gittea write config to XDG_CONFIG_HOME when set#620

Open
rr3khan wants to merge 2 commits into
1Password:mainfrom
rr3khan:fix/gitea-xdg-config-home
Open

fix: Gittea write config to XDG_CONFIG_HOME when set#620
rr3khan wants to merge 2 commits into
1Password:mainfrom
rr3khan:fix/gitea-xdg-config-home

Conversation

@rr3khan

@rr3khan rr3khan commented Jul 3, 2026

Copy link
Copy Markdown

Overview

On macOS with $XDG_CONFIG_HOME exported, op plugin init tea writes tea's config to a path tea never reads, so every tea command fails with Error: no available login.

The plugin resolves the config path with os.UserConfigDir(), which ignores $XDG_CONFIG_HOME on darwin, while tea resolves it through adrg/xdg, which prefers $XDG_CONFIG_HOME on every platform. When the variable is set (common for users syncing dotfiles across Linux and macOS), the two diverge: the plugin writes to ~/Library/Application Support/tea/config.yml while tea reads from $XDG_CONFIG_HOME/tea/config.yml.

ConfigPath() now checks $XDG_CONFIG_HOME first and falls back to os.UserConfigDir(), matching tea's own resolution order. Added tests covering both branches.

Type of change

  • Created a new plugin
  • Improved an existing plugin
  • Fixed a bug in an existing plugin
  • Improved contributor utilities or experience

Related Issue(s)

How To Test

export XDG_CONFIG_HOME=$HOME/.config
op plugin init tea   # link a Gitea personal access token
tea pulls            # previously: Error: no available login

Without $XDG_CONFIG_HOME set, behavior is unchanged (os.UserConfigDir() fallback). go test ./plugins/gitea/... and make gitea/validate pass.

Changelog

The Gitea plugin now writes tea's configuration to the location tea reads when XDG_CONFIG_HOME is set.

@rr3khan rr3khan changed the title fix: write config to XDG_CONFIG_HOME when set fix: Gittea write config to XDG_CONFIG_HOME when set Jul 3, 2026
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.

[gitea] Plugin writes config to a path tea won't read when $XDG_CONFIG_HOME is set

1 participant