Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/pico_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,9 @@ def GenerateCMake(folder, params):
"# (note this can come from environment, CMake cache etc)\n\n"
)

# if you change the do never edit headline you need to change the check for it in extension.mts
# if you change the do not edit headline you need to change the check for it in extension.mts
cmake_header_us = (
"# == DO NEVER EDIT THE NEXT LINES for Raspberry Pi Pico VS Code Extension to work ==\n"
"# == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work ==\n"
"if(WIN32)\n"
" set(USERHOME $ENV{USERPROFILE})\n"
"else()\n"
Expand Down
6 changes: 5 additions & 1 deletion src/utils/cmakeUtil.mts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import { buildCMakeIncPath } from "./download.mjs";

export const CMAKE_DO_NOT_EDIT_HEADER_PREFIX =
// eslint-disable-next-line max-len
"== DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work ==";
export const CMAKE_DO_NOT_EDIT_HEADER_PREFIX_OLD =
// eslint-disable-next-line max-len
"== DO NEVER EDIT THE NEXT LINES for Raspberry Pi Pico VS Code Extension to work ==";

export async function getPythonPath(): Promise<string> {
Expand Down Expand Up @@ -333,7 +336,8 @@ export async function cmakeUpdateSDK(
const cmakeFilePath = join(folder.fsPath, "CMakeLists.txt");
// This regex requires multiline (m) and dotall (s) flags to work
const updateSectionRegex = new RegExp(
`^# ${CMAKE_DO_NOT_EDIT_HEADER_PREFIX}.*# =+$`,
`^# (${CMAKE_DO_NOT_EDIT_HEADER_PREFIX}` +
`|${CMAKE_DO_NOT_EDIT_HEADER_PREFIX_OLD}).*# =+$`,
"ms"
);
const picoBoardRegex = /^set\(PICO_BOARD\s+([^)]+)\)$/m;
Expand Down
Loading