-
Notifications
You must be signed in to change notification settings - Fork 646
Fixes #623 Expand ~ to os.homedir() in gopath #768
Conversation
src/goPath.ts
Outdated
if (workspaceRoot) { | ||
inputPath = inputPath.replace(/\${workspaceRoot}/g, workspaceRoot); | ||
} | ||
return (process.platform === 'win32' || !inputPath.startsWith('~')) ? inputPath : path.join(os.homedir(), inputPath.substr(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not resolve ~ on windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because ~ being the home dir is a POSIX thing. Doesn't apply to Windows.
But I see your point, if there was a workspace setting for go path using ~ checked in to source control, then the same workspace should work on Windows machine.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows has it too now - ~ is expanded (only in powershell), and os.homedir()
returns the right thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one nit, I would switch the condition around (return inputPath.startsWith ...
)
Sure mr. nitpicker :) Will do. |
No description provided.