Skip to content

Commit

Permalink
Respect usernames with spaces on WSL (hashicorp/vagrant#9298 (comment))
Browse files Browse the repository at this point in the history
  • Loading branch information
BR0kEN- committed Feb 13, 2018
1 parent 8b4b3f8 commit 5bc3b71
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ index c86c127d2..30b0fdcbf 100644
+
+ logger.debug("Querying installed WSL from Windows registry.")
+
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split(" ").each do |path|
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split("\r\n").each do |path|
+ # Lowercase the drive letter, skip the next symbol (which is a
+ # colon from a Windows path) and convert path to UNIX style.
+ path = "/mnt/#{path[0, 1].downcase}#{path[2..-1].tr('\\', '/')}/rootfs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ index c86c127d2..30b0fdcbf 100644
+
+ logger.debug("Querying installed WSL from Windows registry.")
+
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split(" ").each do |path|
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split("\r\n").each do |path|
+ # Lowercase the drive letter, skip the next symbol (which is a
+ # colon from a Windows path) and convert path to UNIX style.
+ path = "/mnt/#{path[0, 1].downcase}#{path[2..-1].tr('\\', '/')}/rootfs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ index fc97dcdbe..f2c6761f1 100644
+
+ logger.debug("Querying installed WSL from Windows registry.")
+
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split(" ").each do |path|
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split("\r\n").each do |path|
+ # Lowercase the drive letter, skip the next symbol (which is a
+ # colon from a Windows path) and convert path to UNIX style.
+ path = "/mnt/#{path[0, 1].downcase}#{path[2..-1].tr('\\', '/')}/rootfs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ index b9d4df6d9..27419a505 100644
+
+ logger.debug("Querying installed WSL from Windows registry.")
+
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split(" ").each do |path|
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split("\r\n").each do |path|
+ # Lowercase the drive letter, skip the next symbol (which is a
+ # colon from a Windows path) and convert path to UNIX style.
+ path = "/mnt/#{path[0, 1].downcase}#{path[2..-1].tr('\\', '/')}/rootfs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ index 778f3a7ab..c43cb0a82 100644
+
+ logger.debug("Querying installed WSL from Windows registry.")
+
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split(" ").each do |path|
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split("\r\n").each do |path|
+ # Lowercase the drive letter, skip the next symbol (which is a
+ # colon from a Windows path) and convert path to UNIX style.
+ path = "/mnt/#{path[0, 1].downcase}#{path[2..-1].tr('\\', '/')}/rootfs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ index 4cd8b2e7f..3e52451e8 100644
+
+ logger.debug("Querying installed WSL from Windows registry.")
+
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split(" ").each do |path|
+ PowerShell.execute_cmd('(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').split("\r\n").each do |path|
+ # Lowercase the drive letter, skip the next symbol (which is a
+ # colon from a Windows path) and convert path to UNIX style.
+ path = "/mnt/#{path[0, 1].downcase}#{path[2..-1].tr('\\', '/')}/rootfs"
Expand Down

0 comments on commit 5bc3b71

Please sign in to comment.