diff --git a/src/utils/cmakeUtil.mts b/src/utils/cmakeUtil.mts index c2fc11ea..6522a34b 100644 --- a/src/utils/cmakeUtil.mts +++ b/src/utils/cmakeUtil.mts @@ -16,6 +16,8 @@ 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 = + "== DO NEVER EDIT THE NEXT LINES for the Raspberry Pi Pico VS Code Extension to work =="; export async function getPythonPath(): Promise { const settings = Settings.getInstance(); @@ -333,7 +335,7 @@ 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;