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

Consider using os.homedir() instead of process.env.HOME #4472

Closed
cvaldev opened this issue Jan 4, 2020 · 0 comments
Closed

Consider using os.homedir() instead of process.env.HOME #4472

cvaldev opened this issue Jan 4, 2020 · 0 comments
Assignees

Comments

@cvaldev
Copy link
Contributor

cvaldev commented Jan 4, 2020

Is your feature request related to a problem? Please describe.
While working on #4449 I noticed that inside VimrcImpl we're currently using process.env.HOME to refer to the current user's home directory. This is not platform agnostic as it returns undefined on windows systems. On windows systems we'd have to use process.env.USERPROFILE.

Using process.env.HOME on windows means we can't support expanding ~ or $HOME, nor find the default vimrc.

Describe the solution you'd like
We should switch to os.homedir() as it resolves the home directory correctly regardless of platform.

Additional context
Although I'm not a windows user I did my own testing to verify the behaviour on windows, plus here are some links that support the above.

types/_generator-typings#91
Node.js Find home directory in platform agnostic way

@J-Fields J-Fields self-assigned this Jan 8, 2020
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

No branches or pull requests

2 participants