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 support for the XDG directory specification #590

Merged
merged 2 commits into from
May 21, 2020
Merged

Add support for the XDG directory specification #590

merged 2 commits into from
May 21, 2020

Conversation

tristan957
Copy link
Contributor

@tristan957 tristan957 commented May 19, 2020

I am a Linux user.

Linux users hate when people put dotfiles in the HOME folder.

I noticed your awesome extension <3 puts its folder in the HOME folder.

I implemented backwards-compatible support for the XDG directory specification[1].

In the case ~/.rest-client exists, we continue to use that folder. Otherwise, we use both XDG_CACHE_HOME/rest-client and XDG_CONFIG_HOME/rest-client.

So in my case as a previous user, I would just delete the current folder, and have the extension use the paths because I have those variables defined, as do most Linux users.

1: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

@tristan957
Copy link
Contributor Author

I cannot tell what is wrong with this PR. tslint passes locally for me.

@lgtm-com
Copy link

lgtm-com bot commented May 20, 2020

This pull request introduces 1 alert when merging cf92cc4 into 1ee0dbd - view on LGTM.com

new alerts:

  • 1 for Expression has no effect


if (process.env.XDG_CACHE_HOME !== undefined) {
return path.join(process.env.XDG_CACHE_HOME, restClientDir);
}
Copy link
Owner

Choose a reason for hiding this comment

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

Just a question, if an existing user wants to use the XDG directory, he needs to delete the .rest-client folder first. And they also need to export these two environment variables in shell. right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the user would need to delete it and have the env variables exported. A lot of distributions have these exported by default.

@Huachao Huachao merged commit 1f3cbfd into Huachao:master May 21, 2020
@Huachao
Copy link
Owner

Huachao commented May 21, 2020

@tristan957 Merged, thanks

@tristan957
Copy link
Contributor Author

Thanks very much for your review

@Huachao
Copy link
Owner

Huachao commented Jun 12, 2020

@tristan957 You can try this in the latest version 0.24.0

@tristan957
Copy link
Contributor Author

Perfect I'll let you know how it goes!

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.

2 participants