Skip to content

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

@Xm798

Description

@Xm798

On macOS with $XDG_CONFIG_HOME exported, tea always errors with Error: no available login after op plugin init tea.

The plugin writes to ~/Library/Application Support/tea/config.yml (source, via os.UserConfigDir()), but tea resolves its config through adrg/xdg, which prefers $XDG_CONFIG_HOME when set. Go's os.UserConfigDir() doesn't read $XDG_CONFIG_HOME on darwin, so the two diverge and tea finds an empty config.

Without $XDG_CONFIG_HOME both sides default to ~/Library/Application Support, so it only bites users who export it (common when syncing dotfiles across Linux + macOS).

Repro

macOS, tea 0.14.1, export XDG_CONFIG_HOME=$HOME/.config, op plugin init tea, then tea pullsError: no available login.

Suggested fix

Honor $XDG_CONFIG_HOME first in ConfigPath():

if xdg := os.Getenv("XDG_CONFIG_HOME"); xdg != "" {
    return filepath.Join(xdg, "tea", "config.yml")
}

Workaround

ln -s "$HOME/Library/Application Support/tea" "$XDG_CONFIG_HOME/tea"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions