From 237e5594c652b7af2f0affeb460a47d2ce8a4fe3 Mon Sep 17 00:00:00 2001 From: actboy168 Date: Fri, 14 Apr 2023 09:45:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9theia=20#253?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extension/js/extension.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/extension/js/extension.js b/extension/js/extension.js index 965bba2ec..027456435 100644 --- a/extension/js/extension.js +++ b/extension/js/extension.js @@ -8,27 +8,27 @@ const trackerFactory = require("./trackerFactory"); const pickProcess = require("./pickProcess"); function getExtensionDirectory(context) { - const extensionPath = context.extensionPath - if (path.basename(extensionPath) != 'extension') { - return extensionPath + const envExtensionPath = process.env.VSCODE_EXTENSION_PATH; + if (envExtensionPath === undefined) { + return context.extensionPath } if (os.platform() == "win32") { if (os.arch() == "x64") { - return process.env.VSCODE_EXTENSION_PATH + "-win32-x64" + return envExtensionPath + "-win32-x64" } - return process.env.VSCODE_EXTENSION_PATH + "-win32-ia32" + return envExtensionPath + "-win32-ia32" } else if (os.platform() == "darwin") { if (os.arch() == "arm64") { - return process.env.VSCODE_EXTENSION_PATH + "-darwin-arm64" + return envExtensionPath + "-darwin-arm64" } - return process.env.VSCODE_EXTENSION_PATH + "-darwin-x64" + return envExtensionPath + "-darwin-x64" } else if (os.platform() == "linux") { if (os.arch() == "arm64") { - return process.env.VSCODE_EXTENSION_PATH + "-linux-arm64" + return envExtensionPath + "-linux-arm64" } - return process.env.VSCODE_EXTENSION_PATH + "-linux-x64" + return envExtensionPath + "-linux-x64" } }