Skip to content

Commit 1e9f001

Browse files
authored
Update cmakeUtil.mts
1 parent 7dac920 commit 1e9f001

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/cmakeUtil.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { buildCMakeIncPath } from "./download.mjs";
1616
export const CMAKE_DO_NOT_EDIT_HEADER_PREFIX =
1717
// eslint-disable-next-line max-len
1818
"== DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work ==";
19+
export const CMAKE_DO_NOT_EDIT_HEADER_PREFIX_OLD =
20+
"== DO NEVER EDIT THE NEXT LINES for the Raspberry Pi Pico VS Code Extension to work ==";
1921

2022
export async function getPythonPath(): Promise<string> {
2123
const settings = Settings.getInstance();
@@ -333,7 +335,7 @@ export async function cmakeUpdateSDK(
333335
const cmakeFilePath = join(folder.fsPath, "CMakeLists.txt");
334336
// This regex requires multiline (m) and dotall (s) flags to work
335337
const updateSectionRegex = new RegExp(
336-
`^# ${CMAKE_DO_NOT_EDIT_HEADER_PREFIX}.*# =+$`,
338+
`^# (${CMAKE_DO_NOT_EDIT_HEADER_PREFIX}|${CMAKE_DO_NOT_EDIT_HEADER_PREFIX_OLD}).*# =+$`,
337339
"ms"
338340
);
339341
const picoBoardRegex = /^set\(PICO_BOARD\s+([^)]+)\)$/m;

0 commit comments

Comments
 (0)