]> Git Repo - pico-vscode.git/commitdiff
Fix #13, python3Path setting
authorpaulober <[email protected]>
Wed, 20 Dec 2023 15:51:00 +0000 (16:51 +0100)
committerpaulober <[email protected]>
Wed, 20 Dec 2023 15:51:00 +0000 (16:51 +0100)
scripts/pico_project.py
src/utils/download.mts
src/webview/newProjectPanel.mts

index c784395ff28fdf521b808d20b1f0451b38fd60af..34289619d1ba8b17dfceeb5f2330d396559b1a25 100644 (file)
@@ -1291,7 +1291,7 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger,
 
             if customPython:
                 settings += f''',
-    "raspberry-pi-pico.python3Path": "{sys.executable.replace(user_home, "${HOME}") if use_home_var else sys.executable}"'''
+    "raspberry-pi-pico.python3Path": "{sys.executable.replace("\\", "/").replace(user_home, "${HOME}") if use_home_var else sys.executable}"'''
                 
             settings += '\n}\n'
 
index 11c7a3d190a24ed6f4ff1f433b37325f74fd1663..280ed530f08bc59b61b0f7241b46246eaec36910 100644 (file)
@@ -183,7 +183,8 @@ async function unxzFile(
 export async function downloadAndInstallSDK(
   version: string,
   repositoryUrl: string,
-  settings: Settings
+  settings: Settings,
+  python3Path?: string
 ): Promise<boolean> {
   let gitExecutable: string | undefined =
     settings
@@ -238,8 +239,10 @@ export async function downloadAndInstallSDK(
       gitExecutable
     ))
   ) {
+    settings.reload();
     // check python requirements
     const python3Exe: string =
+      python3Path ||
       settings
         .getString(SettingsKey.python3Path)
         ?.replace(HOME_VAR, homedir().replaceAll("\\", "/")) ||
index b6bda29e798987a4067e7e68c43ca9f428666b10..ef0622ae238ef00e5c3b31d39f1875740b5d5484 100644 (file)
@@ -519,7 +519,9 @@ export class NewProjectPanel {
             !(await downloadAndInstallSDK(
               selectedSDK,
               SDK_REPOSITORY_URL,
-              this._settings
+              this._settings,
+              // python3Path is only possible undefined if downloaded and there is already checked and returned if this happened
+              python3Path!.replace(HOME_VAR, homedir().replaceAll("\\", "/"))
             )) ||
             !(await downloadAndInstallToolchain(selectedToolchain))
           ) {
This page took 0.040286 seconds and 4 git commands to generate.