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

feat(std/node): Added implementation of os.homedir() #873

Merged
merged 3 commits into from
Apr 28, 2021

Conversation

arwtyxouymz
Copy link
Contributor

@arwtyxouymz arwtyxouymz commented Apr 24, 2021

I found the implementation of os.homedir() was lack.
This is related to https://github.com/denoland/deno/issues/3802

@CLAassistant
Copy link

CLAassistant commented Apr 24, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. I left one comment.

node/os.ts Outdated
notImplemented(SEE_GITHUB_ISSUE);
switch (Deno.build.os) {
case "windows":
return Deno.env.get("HOMEPATH") || null;
Copy link
Member

Choose a reason for hiding this comment

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

I think 'USERPROFILE' is more reliable env var for pointing the home directory in windows. See this discussion for example denoland/deno#3462

Node.js documentation also says it uses 'USERPROFILE' https://nodejs.org/api/os.html#os_os_homedir

@arwtyxouymz
Copy link
Contributor Author

@kt3k Thank you for your review. I updated to use USERPROFILE instead of HOMEPATH.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@kt3k kt3k merged commit 2509338 into denoland:main Apr 28, 2021
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.

3 participants