diff --git a/resources/win32/bin/code.sh b/resources/win32/bin/code.sh index bf9f121dfe1..cb32d2baf58 100644 --- a/resources/win32/bin/code.sh +++ b/resources/win32/bin/code.sh @@ -7,19 +7,18 @@ APP_NAME="@@APPNAME@@" QUALITY="@@QUALITY@@" NAME="@@NAME@@" -set -e - if grep -qi Microsoft /proc/version; then # in a wsl shell WIN_CODE_CMD=$(wslpath -w "$(dirname "$(realpath "$0")")/$APP_NAME.cmd") - - WSL_EXT_ID="ms-vscode.remote-wsl" - WSL_EXT_WLOC=$(cmd.exe /c "$WIN_CODE_CMD" --locate-extension $WSL_EXT_ID) - if ! [ -z "$WSL_EXT_WLOC" ]; then - # replace \r\n with \n in WSL_EXT_WLOC, get linux path for - WSL_CODE=$(wslpath -u "${WSL_EXT_WLOC%%[[:cntrl:]]}")/scripts/wslCode.sh - $WSL_CODE $COMMIT $QUALITY "$WIN_CODE_CMD" "$APP_NAME" "$@" - exit $? + if ! [ -z "$WIN_CODE_CMD" ]; then + WSL_EXT_ID="ms-vscode.remote-wsl" + WSL_EXT_WLOC=$(cmd.exe /c "$WIN_CODE_CMD" --locate-extension $WSL_EXT_ID) + if ! [ -z "$WSL_EXT_WLOC" ]; then + # replace \r\n with \n in WSL_EXT_WLOC, get linux path for + WSL_CODE=$(wslpath -u "${WSL_EXT_WLOC%%[[:cntrl:]]}")/scripts/wslCode.sh + $WSL_CODE $COMMIT $QUALITY "$WIN_CODE_CMD" "$APP_NAME" "$@" + exit $? + fi fi fi