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

Update config path to comply with XDG Base Directory spec #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion gitsome/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def get_github_config_path(self, config_file_name):
:rtype: str
:return: The github config file path.
"""
home = os.path.abspath(os.environ.get('HOME', ''))
home = os.path.abspath(os.environ.get('$XDG_CONFIG_HOME', ''))
config_file_path = os.path.join(home, config_file_name)
return config_file_path

Expand Down
3 changes: 2 additions & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def verify_login_pass_url_enterprise(self, username=None, password=None,
assert verify

def test_config(self):
expected = os.path.join(os.path.abspath(os.environ.get('HOME', '')),
expected = os.path.join(os.path.abspath(os.environ.get(
'$XDG_CONFIG_HOME', '')),
self.github.config.CONFIG)
assert self.github.config \
.get_github_config_path(self.github.config.CONFIG) == expected
Expand Down