From b9725ba60997e52110a3d20d0b2d6c84919521ce Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 15 Apr 2019 13:02:53 +0200 Subject: [PATCH] code.sh is broken in WSL after commit "run code wsl in dev ". Fixes #72263 --- scripts/code.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/code.sh b/scripts/code.sh index ba4177c33e5..f8de129630e 100755 --- a/scripts/code.sh +++ b/scripts/code.sh @@ -59,19 +59,19 @@ function code-wsl() { # in a wsl shell local WIN_CODE_CLI_CMD=$(wslpath -w "$ROOT/scripts/code-cli.bat") - - local WSL_EXT_ID="ms-vscode.remote-wsl" - local WSL_EXT_WLOC=$(cmd.exe /c "$WIN_CODE_CLI_CMD" --locate-extension $WSL_EXT_ID) - if ! [ -z "$WSL_EXT_WLOC" ]; then - # replace \r\n with \n in WSL_EXT_WLOC - local WSL_CODE=$(wslpath -u "${WSL_EXT_WLOC%%[[:cntrl:]]}")/scripts/wslCode-dev.sh - $WSL_CODE "$ROOT" "$@" - exit $? + if [ -z "$WSL_EXT_WLOC" ]; then + local WSL_EXT_ID="ms-vscode.remote-wsl" + local WSL_EXT_WLOC=$(cmd.exe /c "$WIN_CODE_CLI_CMD" --locate-extension $WSL_EXT_ID) + if ! [ -z "$WSL_EXT_WLOC" ]; then + # replace \r\n with \n in WSL_EXT_WLOC + local WSL_CODE=$(wslpath -u "${WSL_EXT_WLOC%%[[:cntrl:]]}")/scripts/wslCode-dev.sh + $WSL_CODE "$ROOT" "$@" + exit $? + fi fi } -if [ -z ${IN_WSL+x} ]; then - code "$@" -else +if ! [ -z ${IN_WSL+x} ]; then code-wsl "$@" -fi \ No newline at end of file +fi +code "$@" \ No newline at end of file -- GitLab