]> Git Repo - pico-vscode.git/commitdiff
Fix #12, GIt and Python installation failure
authorpaulober <[email protected]>
Wed, 20 Dec 2023 15:04:22 +0000 (16:04 +0100)
committerpaulober <[email protected]>
Wed, 20 Dec 2023 15:04:22 +0000 (16:04 +0100)
Signed-off-by: paulober <[email protected]>
src/utils/download.mts
src/webview/newProjectPanel.mts

index 0e9a699b1a67c27aa8453ab79b6a6efabfbdd5b3..11c7a3d190a24ed6f4ff1f433b37325f74fd1663 100644 (file)
@@ -897,9 +897,32 @@ export async function downloadGit(
           const success = unzipFile(archiveFilePath, targetDirectory);
           // delete tmp file
           unlinkSync(archiveFilePath);
-          resolve(
-            success ? `${settingsTargetDirectory}/cmd/git.exe` : undefined
-          );
+
+          if (success) {
+            // remove include section from gitconfig included in MiniGit
+            // which hardcodes the a path in Programm Files to be used by this git executable
+            exec(
+              `${
+                process.env.ComSpec === "powershell.exe" ? "&" : ""
+              }"${targetDirectory}/cmd/git.exe" config ` +
+                `--file "${targetDirectory}/etc/gitconfig" ` +
+                "--remove-section include",
+              error => {
+                if (error) {
+                  Logger.log(
+                    `Error executing git: ${
+                      error instanceof Error ? error.message : (error as string)
+                    }`
+                  );
+                  resolve(undefined);
+                } else {
+                  resolve(`${settingsTargetDirectory}/cmd/git.exe`);
+                }
+              }
+            );
+          } else {
+            resolve(undefined);
+          }
         }
       });
 
index 01a28321da15d0a030d81b2e55433c576f27a222..b6bda29e798987a4067e7e68c43ca9f428666b10 100644 (file)
@@ -372,14 +372,6 @@ export class NewProjectPanel {
                 return;
               }
 
-              // give feedback to user
-              // TODO: change into progress message
-              void window.showInformationMessage(
-                `Generating project ${data.projectName ?? "undefined"} in ${
-                  this._projectRoot?.fsPath
-                }, this may take a while...`
-              );
-
               // close panel before generating project
               this.dispose();
 
This page took 0.034416 seconds and 4 git commands to generate.