]> Git Repo - pico-vscode.git/commitdiff
Fixes small bug in webview + unzip on Windows
authorpaulober <[email protected]>
Thu, 14 Dec 2023 00:08:16 +0000 (01:08 +0100)
committerpaulober <[email protected]>
Thu, 14 Dec 2023 00:08:16 +0000 (01:08 +0100)
Signed-off-by: paulober <[email protected]>
scripts/pico_project.py
src/utils/download.mts
web/main.js

index 4cc05a1a6f109b8318c94fe0bc20fb241a75b225..a4cc03489d9de5fae49f3885b13cb0add1d75f28 100644 (file)
@@ -1179,7 +1179,7 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger,
     cPath = compilerPath.as_posix()
 
     # if this is a path in the .pico-sdk homedir tell the settings to use the homevar
-    user_home = os.path.expanduser("~").replace("\\\\", "/")
+    user_home = os.path.expanduser("~").replace("\\", "/")
     use_home_var = f"{user_home}/.pico-sdk" in ninjaPath
 
     for p in projects :
index 35a93213d780d333d69b5cbd4ee18b8402a60929..9fd06eedf173a6d6653776db7adc789f6be5281e 100644 (file)
@@ -4,6 +4,7 @@ import {
   readdirSync,
   renameSync,
   rmdirSync,
+  statSync,
   symlinkSync,
   unlinkSync,
 } from "fs";
@@ -73,14 +74,13 @@ function unzipFile(zipFilePath: string, targetDirectory: string): boolean {
     const zip = new AdmZip(zipFilePath);
     zip.extractAllTo(targetDirectory, true, true);
 
+    const targetDirContents = readdirSync(targetDirectory);
     if (
       process.platform === "win32" &&
-      readdirSync(targetDirectory).length === 1
+      targetDirContents.length === 1 &&
+      statSync(targetDirContents[0]).isDirectory()
     ) {
-      const subfolderPath = join(
-        targetDirectory,
-        readdirSync(targetDirectory)[0]
-      );
+      const subfolderPath = join(targetDirectory, targetDirContents[0]);
       readdirSync(subfolderPath).forEach(item => {
         const itemPath = join(subfolderPath, item);
         const newItemPath = join(targetDirectory, item);
index 1108067faa8a09efce09e74d4373da187cf69ac2..90a020eb12ae3ee80d738952a9c0064edd4945f7 100644 (file)
@@ -162,7 +162,7 @@ var isPicoWireless = false;
 
       return;
     }
-    if (cmakeMode == 2) {
+    if (pythonMode == 2) {
       const files = document.getElementById('python-path-executable').files;
 
       if (files.length == 1) {
This page took 0.041988 seconds and 4 git commands to generate.