-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
WSL2 installation: Escaped asterisks while echoing ddev and docker sources as it list directory contents without it [skip ci] #4731
Conversation
Thanks for the work here. Are you perhaps not using PowerShell v5? I've tested both of these scripts quite a number of times. When you create a PR though, please give a description and explain what the issues are. A screenshot just isn't enough to explain it. |
Yes sorry I am using the latest: |
As stated in the instructions, please run this with PowerShell 5. I haven't been able to figure out a way to get it to work with both. |
|
Maybe there's a way to detect the PS version and abort the script? |
I just tried with version 5, and you are right, it works good. |
It has to more than look good. It has to be tested with both. If you can test this with both PS5 and PS7 successfully, we can go forward. Like I say, I didn't succeed. But you need to avoid the trap of an existing setup. Not all the same things fail if you have already run it successfully once. So please create a new WSL2 distro each time when testing. This was already approached in |
Yes you are right. I now tested on both. PS 7 output
Then I installed WSL Ubuntu 20.04 and set it to default. Tried with PowerShell 5. PS5 ouput``` PS C:\Users\oMikR> wsl --install Ubuntu-20.04 Installing: Ubuntu 20.04 LTS Ubuntu 20.04 LTS has been installed. Launching Ubuntu 20.04 LTS... Installing, this may take a few minutes... Please create a default UNIX user account. The username does not need to match your Windows username. For more information visit: https://aka.ms/wslusers Enter new UNIX username: alex New password: Retype new password: passwd: password updated successfully Installation successful! To run a command as administrator (user "root"), use "sudo ". See "man sudo_root" for details.Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64)
System information as of Fri Mar 10 11:41:35 EET 2023 System load: 0.22 Processes: 9 1 update can be applied immediately. The list of available updates is more than a week old. This message is shown once a day. To disable it please create the Chocolatey upgraded 0/3 packages. SUCCESS: Specified value was saved.
PS C:\Users\oMikR> $PSVersionTable Name Value PSVersion 5.1.22621.963 PS C:\Users\oMikR> wsl -u root -e bash -c 'cat /etc/apt/sources.list.d/docker.list' PS C:\Users\oMikR> wsl -u root -e bash -c 'cat /etc/apt/sources.list.d/ddev.list'
|
I would love to have a solution that works both places. And of course I'd rather it be an installer instead of a script. PS is very much an unfamiliar language, and nobody has pointed out why something as important as quoting would work differently between PS5 and PS7. But since 5 is the standard... we'll have to stick with it as preferred. I'd love to have you come up with something that works both places. |
Closing this for now, but if you can either improve it by checking the PS version and saying "Can't do with PS 7" or edit it so it works both places, it will be very welcome. Thanks for giving it a try! |
I already tried it in both versions and works for me. Maybe its my bad English. Sorry :( |
You agreed that I was correct about the problem above in #4731 (comment) :) You do have to start with a fresh WSL2 distro to demonstrate the problem. Running your version with PS7 and then PS5 will work, but running your version with a fresh WSL2 and PS5 will not. Again, if you can either improve it by checking the PS version and saying "Can't do with PS 7" or edit it so it works both places, it will be very welcome |
Yes I said that you were correct that PS5 worked just fine with your code. |
Sorry, I guess we're having language difficulties. I think you know I carefully tested the exact same PR in and found it didn't work with PS5. Is there are difference between your PR and that one? |
Yeah looks different: Mine: And scarselli: |
Ah, so your is not using the nested double-quotes at all. Maybe it could work. Thanks for looking closely. I don't like echoing random content without quotes but you've escaped the asterisks so it's more-or-less safe. I'll reopen and hope to test this in coming days. As you know (thanks) it's a bit of work :) |
Thanks a lot for your time @rfay |
Removed duplicated line for docker.list file |
Thanks for your effort on this, it's going to help a lot. You seem very confident of your testing, so please update the install doc with the PR to remove the constraints about PS5. I'm way behind on PRs will will get there. And this one takes some effort to test as you already know. |
…rectory contents without it
I updated the docker-desktop script and the docs and tested on PS5 and PS7, thanks for solving this! |
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.
Ooooh, I’m fond of removing docs because life is better and requires fewer warnings. Looks great to me! 👏
The Issue
How This PR Solves The Issue
Manual Testing Instructions
Automated Testing Overview
Related Issue Link(s)
Release/Deployment Notes