r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.36k stars 160 forks source link

Option (or default behavior) to update all WSL distros, not just default #855

Closed Lim-Dul closed 2 years ago

Lim-Dul commented 2 years ago

I was amazed to find out that topgrade updates WSL on Windows as long as the distro has it installed but it only does that for the one that is set as default since it runs the wsl command without additional distro parameters.

From what I've seen in the source code the command wsl bash -c exec topgrade or something along those lines is executed after checking wsl and probing for topgrade.

One could imagine running a wsl --list first and piping this into a loop iterating over all found distros (~foreach Distro in pseudo-code) executing the step commands with a wsl -d <DISTRONAME> prefix.

Don't know if this would be the desired behavior for everyone but as someone who has quite a few distros installed on WSL it would be quite useful to me at least as an option.