mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
fix: insiders cli launch from wsl terminal (#279444)
* fix: insiders cli launch from wsl terminal * chore: also update server cli * chore: address review feedback
This commit is contained in:
@@ -39,7 +39,7 @@ fi
|
|||||||
if [ $IN_WSL = true ]; then
|
if [ $IN_WSL = true ]; then
|
||||||
|
|
||||||
export WSLENV="ELECTRON_RUN_AS_NODE/w:$WSLENV"
|
export WSLENV="ELECTRON_RUN_AS_NODE/w:$WSLENV"
|
||||||
CLI=$(wslpath -m "$VSCODE_PATH/resources/app/out/cli.js")
|
CLI=$(wslpath -m "$VSCODE_PATH/$VERSIONFOLDER/resources/app/out/cli.js")
|
||||||
|
|
||||||
# use the Remote WSL extension if installed
|
# use the Remote WSL extension if installed
|
||||||
WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
||||||
|
|||||||
@@ -279,7 +279,12 @@ export async function main(desc: ProductDescription, args: string[]): Promise<vo
|
|||||||
} else {
|
} else {
|
||||||
const cliCwd = dirname(cliCommand);
|
const cliCwd = dirname(cliCommand);
|
||||||
const env = { ...process.env, ELECTRON_RUN_AS_NODE: '1' };
|
const env = { ...process.env, ELECTRON_RUN_AS_NODE: '1' };
|
||||||
|
const versionFolder = desc.commit.substring(0, 10);
|
||||||
|
if (fs.existsSync(join(cliCwd, versionFolder))) {
|
||||||
|
newCommandline.unshift(`${versionFolder}/resources/app/out/cli.js`);
|
||||||
|
} else {
|
||||||
newCommandline.unshift('resources/app/out/cli.js');
|
newCommandline.unshift('resources/app/out/cli.js');
|
||||||
|
}
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
console.log(`Invoking: cd "${cliCwd}" && ELECTRON_RUN_AS_NODE=1 "${cliCommand}" "${newCommandline.join('" "')}"`);
|
console.log(`Invoking: cd "${cliCwd}" && ELECTRON_RUN_AS_NODE=1 "${cliCommand}" "${newCommandline.join('" "')}"`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user