Merge pull request #44945 from 0xabu/wsl-cli-fix
enable CLI when invoked from WSL on modern (RS4) hosts
This commit is contained in:
commit
005666c43e
|
@ -7,14 +7,20 @@ NAME="@@NAME@@"
|
||||||
VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")"
|
VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")"
|
||||||
ELECTRON="$VSCODE_PATH/$NAME.exe"
|
ELECTRON="$VSCODE_PATH/$NAME.exe"
|
||||||
if grep -q Microsoft /proc/version; then
|
if grep -q Microsoft /proc/version; then
|
||||||
# If running under WSL don't pass cli.js to Electron as environment vars
|
if [ -x /bin/wslpath ]; then
|
||||||
# cannot be transferred from WSL to Windows
|
# On recent WSL builds, we just need to set WSLENV so that
|
||||||
# See: https://github.com/Microsoft/BashOnWindows/issues/1363
|
# ELECTRON_RUN_AS_NODE is visible to the win32 process
|
||||||
# https://github.com/Microsoft/BashOnWindows/issues/1494
|
export WSLENV=ELECTRON_RUN_AS_NODE/w:$WSLENV
|
||||||
"$ELECTRON" "$@"
|
CLI=$(wslpath -m "$VSCODE_PATH/resources/app/out/cli.js")
|
||||||
exit $?
|
else
|
||||||
fi
|
# If running under older WSL, don't pass cli.js to Electron as
|
||||||
if [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then
|
# environment vars cannot be transferred from WSL to Windows
|
||||||
|
# See: https://github.com/Microsoft/BashOnWindows/issues/1363
|
||||||
|
# https://github.com/Microsoft/BashOnWindows/issues/1494
|
||||||
|
"$ELECTRON" "$@"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then
|
||||||
CLI=$(cygpath -m "$VSCODE_PATH/resources/app/out/cli.js")
|
CLI=$(cygpath -m "$VSCODE_PATH/resources/app/out/cli.js")
|
||||||
else
|
else
|
||||||
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
||||||
|
|
Loading…
Reference in a new issue