From 08b00bdf2605c5bdbb75da71ac86f0378fb540fc Mon Sep 17 00:00:00 2001 From: Brian Ignacio Date: Fri, 17 Jan 2025 18:14:56 +0800 Subject: [PATCH] useIdfSetupSettings use idfSetup python if exist --- src/setup/setupValidation/espIdfSetup.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/setup/setupValidation/espIdfSetup.ts b/src/setup/setupValidation/espIdfSetup.ts index 2b13c2536..3356c5217 100644 --- a/src/setup/setupValidation/espIdfSetup.ts +++ b/src/setup/setupValidation/espIdfSetup.ts @@ -24,7 +24,10 @@ import { pathExists } from "fs-extra"; import { Logger } from "../../logger/logger"; import { checkPyVenv } from "./pythonEnv"; import { ConfigurationTarget, StatusBarItem, Uri } from "vscode"; -import { getPythonEnvPath } from "../../pythonManager"; +import { + getPythonEnvPath, + getSystemPythonFromSettings, +} from "../../pythonManager"; export async function useIdfSetupSettings( setupConf: IdfSetup, @@ -32,11 +35,21 @@ export async function useIdfSetupSettings( workspaceFolderUri: Uri, espIdfStatusBar: StatusBarItem ) { + let sysPythonBinPath = ""; + if (setupConf.python) { + sysPythonBinPath = await getSystemPythonFromSettings( + setupConf.python, + setupConf.idfPath, + setupConf.toolsPath + ); + } else { + sysPythonBinPath = setupConf.sysPythonPath; + } await saveSettings( setupConf.idfPath, setupConf.toolsPath, setupConf.gitPath, - setupConf.sysPythonPath, + sysPythonBinPath, saveScope, workspaceFolderUri, espIdfStatusBar,