Skip to content

Commit 085b99b

Browse files
committed
Dynamic task executable paths via commands
Signed-off-by: paulober <[email protected]>
1 parent f695b82 commit 085b99b

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

scripts/pico_project.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,10 +1182,10 @@ def generateProjectFiles(
11821182
{{
11831183
"label": "Run Project",
11841184
"type": "process",
1185-
"command": "{propertiesPicotoolPath(picotoolVersion, force_non_windows=True)}/picotool/picotool",
1185+
"command": "${{command:raspberry-pi-pico.getPicotoolPath}}",
11861186
"args": [
11871187
"load",
1188-
"${{command:raspberry-pi-pico.launchTargetPath}}",
1188+
"\\"${{command:raspberry-pi-pico.launchTargetPath}}\\"",
11891189
"-fx"
11901190
],
11911191
"presentation": {{
@@ -1194,16 +1194,16 @@ def generateProjectFiles(
11941194
}},
11951195
"problemMatcher": [],
11961196
"windows": {{
1197-
"command": "{propertiesPicotoolPath(picotoolVersion, force_windows=True)}/picotool/picotool.exe"
1197+
"command": "\\\\\\\\?\\\\${{command:raspberry-pi-pico.getPicotoolPath}}"
11981198
}}
11991199
}},
12001200
{{
12011201
"label": "Flash",
12021202
"type": "process",
1203-
"command": "{openocd_path if openocd_path else "openocd"}",
1203+
"command": "${{command:raspberry-pi-pico.getOpenOCDRoot}}/openocd.exe",
12041204
"args": [
12051205
"-s",
1206-
"{codeOpenOCDPath(openOCDVersion)}/scripts",
1206+
"${{command:raspberry-pi-pico.getOpenOCDRoot}}/scripts",
12071207
"-f",
12081208
"{debugger}",
12091209
"-f",
@@ -1213,16 +1213,16 @@ def generateProjectFiles(
12131213
],
12141214
"problemMatcher": [],
12151215
"windows": {{
1216-
"command": "{openocd_path.replace("${userHome}", "${env:USERPROFILE}") if openocd_path else "openocd"}",
1216+
"command": "\\\\\\\\?\\\\${{command:raspberry-pi-pico.getOpenOCDRoot}}/openocd.exe",
12171217
}}
12181218
}},
12191219
{{
12201220
"label": "Rescue Reset",
12211221
"type": "process",
1222-
"command": "{openocd_path if openocd_path else "openocd"}",
1222+
"command": "${{command:raspberry-pi-pico.getOpenOCDRoot}}/openocd.exe",
12231223
"args": [
12241224
"-s",
1225-
"{codeOpenOCDPath(openOCDVersion)}/scripts",
1225+
"${{command:raspberry-pi-pico.getOpenOCDRoot}}/scripts",
12261226
"-f",
12271227
"{debugger}",
12281228
"-f",
@@ -1232,16 +1232,16 @@ def generateProjectFiles(
12321232
],
12331233
"problemMatcher": [],
12341234
"windows": {{
1235-
"command": "{openocd_path.replace("${userHome}", "${env:USERPROFILE}") if openocd_path else "openocd"}",
1235+
"command": "\\\\\\\\?\\\\${{command:raspberry-pi-pico.getOpenOCDRoot}}/openocd.exe",
12361236
}}
12371237
}},
12381238
{{
1239-
"label": "Risc-V Reset (RP2350)",
1239+
"label": "RISC-V Reset (RP2350)",
12401240
"type": "process",
1241-
"command": "{openocd_path if openocd_path else "openocd"}",
1241+
"command": "${{command:raspberry-pi-pico.getOpenOCDRoot}}/openocd.exe",
12421242
"args": [
12431243
"-s",
1244-
"{codeOpenOCDPath(openOCDVersion)}/scripts",
1244+
"${{command:raspberry-pi-pico.getOpenOCDRoot}}/scripts",
12451245
"-c",
12461246
"set USE_CORE {{ rv0 rv1 cm0 cm1 }}",
12471247
"-f",
@@ -1257,7 +1257,7 @@ def generateProjectFiles(
12571257
],
12581258
"problemMatcher": [],
12591259
"windows": {{
1260-
"command": "{openocd_path.replace("${userHome}", "${env:USERPROFILE}") if openocd_path else "openocd"}",
1260+
"command": "\\\\\\\\?\\\\${{command:raspberry-pi-pico.getOpenOCDRoot}}/openocd.exe",
12611261
}}
12621262
}}
12631263
]

src/commands/getPaths.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ export class GetPicotoolPathCommand extends CommandWithResult<
497497

498498
// TODO: maybe move "picotool" into buildPath or install it so the files
499499
// are in root of buildPath
500-
return join(
500+
return joinPosix(
501501
buildPicotoolPath(picotoolVersion),
502502
"picotool",
503503
process.platform === "win32" ? "picotool.exe" : "picotool"

0 commit comments

Comments
 (0)