#cPath = f"${{env:PICO_TOOLCHAIN_PATH_{envSuffix}}}" + os.path.sep + os.path.basename(str(compilerPath).replace('\\', '\\\\' ))
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("\\\\", "/")
+ use_home_var = f"{user_home}/.pico-sdk" in ninjaPath
+
for p in projects :
if p == 'vscode':
launch = f'''{{
"cmake.generator": "Ninja",
"cmake.cmakePath": "{cmakePath}",
"raspberry-pi-pico.cmakeAutoConfigure": true,
- "raspberry-pi-pico.cmakePath": "{cmakePath}",
- "raspberry-pi-pico.ninjaPath": "{ninjaPath}"
+ "raspberry-pi-pico.cmakePath": "{cmakePath.replace(user_home, "${HOME}") if use_home_var else cmakePath}",
+ "raspberry-pi-pico.ninjaPath": "{ninjaPath.replace(user_home, "${HOME}") if use_home_var else ninjaPath}"
}}
'''
{{
"label": "Compile Project",
"type": "shell",
- "command": "{ninjaPath}",
+ "command": "{ninjaPath.replace(user_home, "${userHome}") if use_home_var else ninjaPath}",
"args": ["-C", "${{workspaceFolder}}/build"],
"group": "build",
"presentation": {{
settings: Settings
): Promise<boolean> {
const gitExecutable =
- settings.getString(SettingsKey.gitPath)?.replace(HOME_VAR, homedir()) ||
- "git";
+ settings
+ .getString(SettingsKey.gitPath)
+ ?.replace(HOME_VAR, homedir().replaceAll("\\", "/")) || "git";
const requirementsCheck = await checkForInstallationRequirements(
settings,
const python3Exe: string =
settings
.getString(SettingsKey.python3Path)
- ?.replace(HOME_VAR, homedir()) || process.platform === "win32"
+ ?.replace(HOME_VAR, homedir().replaceAll("\\", "/")) ||
+ process.platform === "win32"
? "python"
: "python3";
const python3: string | null = await which(python3Exe, { nothrow: true });
if (existsSync(targetDirectory)) {
Logger.log(`Git is already installed.`);
- return `${settingsTargetDirectory}/git` + `/${GIT_MACOS_VERSION}/bin/git`;
+ return process.platform === "win32"
+ ? `${settingsTargetDirectory}/cmd/git.exe`
+ : `${settingsTargetDirectory}/bin/git`;
}
// Ensure the target directory exists
.then(success => {
unlinkSync(archiveFilePath);
resolve(
- success
- ? `${settingsTargetDirectory}/git` +
- `/${GIT_MACOS_VERSION}/bin/git`
- : undefined
+ success ? `${settingsTargetDirectory}/bin/git` : undefined
);
})
.catch(() => {