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

Support updated WSL implementation #9525

Merged
merged 13 commits into from
Feb 28, 2018

Conversation

chrisroberts
Copy link
Member

This is an extension of great work provided by @BR0kEN- in #9300. Updated to support the old lxrun generated WSL instances as well as the new store installed instances. Included some spec coverage on the behavior as well.

logger.debug("checking registry for WSL installation path")
paths += PowerShell.execute_cmd(
'(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss ' \
'| ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').to_s.split("\r\n").map(&:strip)
Copy link
Member

Choose a reason for hiding this comment

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

Should we put a rescue in place here, in case the execute_cmd fails and returns nil? Otherwise we'll get an exception that nil.map is undefined. We could also run the command first before running map on it and adding it to paths and check the result of the Powershell command.

Copy link
Member Author

Choose a reason for hiding this comment

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

The #to_s call will force the type so there's no need to rescue here.

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants