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 :
readdirSync,
renameSync,
rmdirSync,
+ statSync,
symlinkSync,
unlinkSync,
} from "fs";
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);