mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Merge from vscode 6268feb42ba4f2e2fa15484e88c9af60d254998c (#6530)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
|
||||
@@ -58,15 +58,21 @@ function code() {
|
||||
function code-wsl()
|
||||
{
|
||||
# in a wsl shell
|
||||
local WIN_CODE_CLI_CMD=$(wslpath -w "$ROOT/scripts/code-cli.bat" 2>/dev/null)
|
||||
if ! [ -z "$WIN_CODE_CLI_CMD" ]; then
|
||||
ELECTRON="$ROOT/.build/electron/Code - OSS.exe"
|
||||
if [ -f "$ELECTRON" ]; then
|
||||
local CWD=$(pwd)
|
||||
cd $ROOT
|
||||
export WSLENV=ELECTRON_RUN_AS_NODE/w:$WSLENV
|
||||
local WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
||||
local WSL_EXT_WLOC=$(cmd.exe /c "$WIN_CODE_CLI_CMD" --locate-extension $WSL_EXT_ID)
|
||||
if ! [ -z "$WSL_EXT_WLOC" ]; then
|
||||
local WSL_EXT_WLOC=$(ELECTRON_RUN_AS_NODE=1 "$ROOT/.build/electron/Code - OSS.exe" "out/cli.js" --locate-extension $WSL_EXT_ID)
|
||||
cd $CWD
|
||||
if [ -n "$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 $?
|
||||
else
|
||||
echo "Remote WSL not installed, trying to run VSCode in WSL."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -74,4 +80,4 @@ function code-wsl()
|
||||
if ! [ -z ${IN_WSL+x} ]; then
|
||||
code-wsl "$@"
|
||||
fi
|
||||
code "$@"
|
||||
code "$@"
|
||||
|
||||
Reference in New Issue
Block a user