Helper script now works on wsl with modified roots

This commit is contained in:
Nadav Ruskin 2018-05-27 11:36:59 +03:00
parent 187afc10d7
commit 406a1b60f9

View File

@ -183,18 +183,15 @@ fi
# Change the PWD when working in Docker on Windows
if [ -n "$UBUNTU_ON_WINDOWS" ]; then
WSL_ROOT = "/\/mnt\//"
WSL_ROOT="/mnt/"
CFG_FILE=/etc/wsl.conf
CFG_CONTENT=$(cat $CFG_FILE | sed -r '/[^=]+=[^=]+/!d' | sed -r 's/\s+=\s/=/g')
eval "$CFG_CONTENT"
if [ -n "$root"]
if [ -n "$root" ]; then
WSL_ROOT=$root
fi
HOST_PWD=`pwd -P`
HOST_PWD=${HOST_PWD/$WSL_ROOT//}
HOST_PWD=${HOST_PWD/\//:\/}
elif [ -n "$MSYS" ]; then
HOST_PWD=$PWD
HOST_PWD=${HOST_PWD/\//}