Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix python env bin update after re onboarding (VSC-247) #42

Merged
merged 1 commit into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/onboarding/pythonReqsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export async function installPythonRequirements(workingDir: string) {
const idfToolsPath = idfConf.readParameter("idf.toolsPath") as string;
const logTracker = new PyReqLog(sendPyReqLog);
process.env.IDF_PATH = espIdfPath || process.env.IDF_PATH;
await pythonManager.installPythonEnv(
return await pythonManager.installPythonEnv(
espIdfPath, idfToolsPath, logTracker, pythonBinPath, OutputChannel.init())
.then((virtualEnvPythonBin) => {
if (virtualEnvPythonBin) {
Expand All @@ -81,6 +81,7 @@ export async function installPythonRequirements(workingDir: string) {
if (logTracker.Log.indexOf("Exception") < 0) {
OnBoardingPanel.postMessage({ command: "set_py_setup_finish" });
}
return virtualEnvPythonBin;
} else {
OutputChannel.appendLine("Python requirements has not been installed.");
}
Expand Down
4 changes: 2 additions & 2 deletions src/onboarding/toolsInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ export async function downloadToolsInIdfToolsPath(workingDir: string,
});
OutputChannel.appendLine("Installing python virtualenv and ESP-IDF python requirements...");
Logger.info("Installing python virtualenv and ESP-IDF python requirements...");
await installPythonRequirements(workingDir).catch((reason) => {
const pyEnvResult = await installPythonRequirements(workingDir).catch((reason) => {
OutputChannel.appendLine(reason);
Logger.info(reason);
});
let exportPaths = await idfToolsManager.exportPaths(path.join(installDir, "tools"));
const pythonSystemBinPath = idfConf.readParameter("idf.pythonSystemBinPath") as string;
const pythonBinPath = idfConf.readParameter("idf.pythonBinPath") as string;
const pythonBinPath = pyEnvResult || idfConf.readParameter("idf.pythonBinPath") as string;
// Append System Python and Virtual Env Python to PATH
exportPaths = path.dirname(pythonBinPath) + path.delimiter +
path.dirname(pythonSystemBinPath) + path.delimiter + exportPaths;
Expand Down