From 3ca85433c6e944cfc7544b9427f52a6fd4bb401d Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Wed, 1 Sep 2021 19:12:05 -0700 Subject: [PATCH] Add polish --- src/vs/code/node/cli.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/code/node/cli.ts b/src/vs/code/node/cli.ts index d1f1bdb1f735f..26c8b50d54e60 100644 --- a/src/vs/code/node/cli.ts +++ b/src/vs/code/node/cli.ts @@ -361,16 +361,16 @@ export async function main(argv: string[]): Promise { } const argsArr: string[] = []; const isDev = env['VSCODE_DEV']; - // When we're in development mode, call the OSS app rather than the OSS app's Electron - const execPathToUse = isDev ? resolve(join(process.execPath, '../../..')) : process.execPath; + const execPathToUse = process.execPath; argsArr.push('-a', execPathToUse); argsArr.push(...openArgs, '--args', ...argv.slice(2)); if (isDev) { // If we're in development mode, replace the . arg with the // vscode source arg. Because the OSS app isn't bundled, // it needs the vscode source arg to launch properly. - const launchDirIndex = argsArr.indexOf('.'); - argsArr[launchDirIndex] = resolve(join(execPathToUse, '../../..')); + const curdir = '.'; + const launchDirIndex = argsArr.indexOf(curdir); + argsArr[launchDirIndex] = resolve(curdir); } child = spawn('open', argsArr, options);