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

Add XDG_CONFIG_HOME support. #436

Closed
wants to merge 3 commits into from
Closed

Conversation

Yamakaky
Copy link

On Linux and Mac, the default config directory is now "/.config/httpie" instead
of "
/.httpie". Fixes #145

On Linux and Mac, the default config directory is now "~/.config/httpie" instead
of "~/.httpie".
@Earnestly
Copy link

Make sure the path in XDG_CONFIG_HOME when set is absolute. I.e. XDG_CONFIG_HOME[0] == '/'

@Yamakaky
Copy link
Author

Yamakaky commented Mar 1, 2016

If it's not, then issue an error?

@Earnestly
Copy link

Full disclaimer: I don't care about strict adherence and would rather something instead of nothing, so for example I don't care about people implementing support for XDG_CONFIG_DIRS until it actually matters, because usually it doesn't.

As to your question, if the path set in XDG_CONFIG_HOME isn't absolute then you should use the fallback HOME/.config.

@Yamakaky
Copy link
Author

Yamakaky commented Mar 1, 2016

Done !

@jleclanche
Copy link

@jkbrzt Hey, any blocker to merge this? It looks good.

@ghost
Copy link

ghost commented Nov 20, 2016

Any progress?

@Earnestly
Copy link

Three months later, any news?

@ghost
Copy link

ghost commented Jan 28, 2017

@jkbrzt ?

@Siilwyn
Copy link

Siilwyn commented May 11, 2017

@jakubroztocil thoughts?

Would love if this gets merged, my home directory would be thankful.

@jleclanche
Copy link

@jakubroztocil Will this be merged? Will this not be merged? Can I help land it?

@Siilwyn
Copy link

Siilwyn commented Apr 11, 2018

☝️ same questions, if I can help by testing this locally or something else please let me know! Eagerly waiting for this to land. :)

@jleclanche
Copy link

@jakubroztocil ping - see above

@aaronmehar
Copy link

@jakubroztocil Any plans to merge this at some point?

@neersighted
Copy link

I would also like to see this merged. @jakubroztocil, do you have any opposition to merging as-is?

@jkbrzt
Copy link
Member

jkbrzt commented Dec 2, 2018

The problem with this patch is that it changes the default config location without taking into account existing installations — people would end up with two config files one of them being be ignored (extremely bad user experience). It also assumes the existence of ~/.config/.

̉For this to be mergeable, it would need to:

  • provide a "notify & migrate" mechanism for existing users
  • have tests
  • update the docs

@jleclanche
Copy link

provide a "notify & migrate" mechanism for existing users

Can just attempt to read ~/.httpie first and move it automatically if it exists right?

@neersighted
Copy link

Ah, I didn't notice the lack of legacy support. I would just add another branch to the if tree, before the end, that checks if ~/.httpie exists and just short-circuits the logic to use that folder.

jkbrzt pushed a commit that referenced this pull request May 21, 2020
On Unix-like systems, the configuration file now lives in
$XDG_CONFIG_HOME/httpie/ by default, not ~/.httpie/ (the behaviour on
Windows is unchanged). The previous location is still checked, in order
to support existing installations.

Searching $XDG_CONFIG_DIRS is still not supported.

Fixes #145; supersedes #436.
@jkbrzt jkbrzt closed this May 21, 2020
@Yamakaky Yamakaky deleted the xdg_support branch May 21, 2020 14:10
nrocco added a commit to nrocco/consume that referenced this pull request Jan 22, 2022
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.

Follow the XDG base directory specification
7 participants