Skip to content

Commit

Permalink
fix: wsl -l -q output parsing
Browse files Browse the repository at this point in the history
It seemed as wsl -l -q works fine without any replacing, but replacing
of newlines is still required, otherwise the script breaks in some cases.
  • Loading branch information
pxlrbt committed Jul 7, 2020
1 parent 09b51a9 commit 1c06540
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion move-wsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ $# -eq 2 ]; then
WSL_TARGET=$2
else
# Select distro
WSL_DISTROS=($(wsl -l -q | iconv -f UTF-16LE -t UTF-8))
WSL_DISTROS=($(wsl -l -q | iconv -f UTF-16LE -t UTF-8 | sed "s/\r\n/\n/g"))
PS3="Select distro to move: "
select WSL_NAME in ${WSL_DISTROS[@]}; do
if [ 1 -le "$REPLY" ] && [ "$REPLY" -le ${#WSL_DISTROS[@]} ];
Expand Down

0 comments on commit 1c06540

Please sign in to comment.