Merge pull request #229 from Nadav-Eyesight/wsl_better_support

Wsl better support
This commit is contained in:
Matt McCormick 2018-06-06 21:30:55 -04:00 committed by GitHub
commit 9d4bb8a0eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,9 +183,15 @@ fi
# Change the PWD when working in Docker on Windows # Change the PWD when working in Docker on Windows
if [ -n "$UBUNTU_ON_WINDOWS" ]; then if [ -n "$UBUNTU_ON_WINDOWS" ]; then
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" ]; then
WSL_ROOT=$root
fi
HOST_PWD=`pwd -P` HOST_PWD=`pwd -P`
HOST_PWD=${HOST_PWD/\/mnt\//} HOST_PWD=${HOST_PWD/$WSL_ROOT//}
HOST_PWD=${HOST_PWD/\//:\/}
elif [ -n "$MSYS" ]; then elif [ -n "$MSYS" ]; then
HOST_PWD=$PWD HOST_PWD=$PWD
HOST_PWD=${HOST_PWD/\//} HOST_PWD=${HOST_PWD/\//}