fix wsl selfhosting in scripts/code.sh

This commit is contained in:
Martin Aeschlimann 2020-09-16 23:55:34 +02:00
parent 289bce5e1a
commit a8581d60f2
2 changed files with 3 additions and 7 deletions

View file

@ -57,9 +57,9 @@ function code-wsl()
if [ -f "$ELECTRON" ]; then
local CWD=$(pwd)
cd $ROOT
export WSLENV=ELECTRON_RUN_AS_NODE/w:$WSLENV
export WSLENV=ELECTRON_RUN_AS_NODE/w:VSCODE_DEV/w:$WSLENV
local WSL_EXT_ID="ms-vscode-remote.remote-wsl"
local WSL_EXT_WLOC=$(ELECTRON_RUN_AS_NODE=1 "$ROOT/.build/electron/Code - OSS.exe" "out/cli.js" --locate-extension $WSL_EXT_ID)
local WSL_EXT_WLOC=$(VSCODE_DEV=1 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

View file

@ -60,11 +60,7 @@ export function parseMainProcessArgv(processArgv: string[]): NativeParsedArgs {
* Use this to parse raw code CLI process.argv such as: `Electron cli.js . --verbose --wait`
*/
export function parseCLIProcessArgv(processArgv: string[]): NativeParsedArgs {
let [, , ...args] = processArgv;
if (process.env['VSCODE_DEV']) {
args = stripAppPath(args) || [];
}
let [, , ...args] = processArgv; // remove the first non-option argument: it's always the app location
return parseAndValidate(args, true);
}