Fix WSL uname test

On WSL2, Ubuntu 20.04.1, `uname -r` == `4.19.128-microsoft-standard`, so it won't match `/Microsoft$/` because both wrong case and non-final.

I've changed it to use a simple regex.
This commit is contained in:
Sai 2020-10-07 18:42:59 +01:00 committed by GitHub
parent 6b50aed572
commit f739f36efd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ if command -v "cygpath" > /dev/null; then
ATOMCMD=$(cygpath "$(dirname "$0")/atom.cmd" -a -w)
else
pushd "$(dirname "$0")" > /dev/null
if [[ $(uname -r) == *-Microsoft ]]; then
if [[ $(uname -r) =~ "(M|m)icrosoft" ]]; then
# We are in Windows Subsystem for Linux, map /mnt/drive
root="/mnt/"
# If different root mount point defined in /etc/wsl.conf, use that instead