fix(patches): silence false warnings for already-applied patches
- patch-ap-allow-private-address: detect allowPrivateAddress in source - patch-endpoint-posts-ai-cleanup: detect any AI field key variant Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,12 +74,12 @@ for (const filePath of candidates) {
|
|||||||
checked += 1;
|
checked += 1;
|
||||||
const source = await readFile(filePath, "utf8");
|
const source = await readFile(filePath, "utf8");
|
||||||
|
|
||||||
if (source.includes(MARKER)) {
|
if (source.includes(MARKER) || source.includes("allowPrivateAddress")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!source.includes(OLD_SNIPPET)) {
|
if (!source.includes(OLD_SNIPPET)) {
|
||||||
console.log(`[postinstall] patch-ap-allow-private-address: snippet not found in ${filePath}`);
|
console.log(`[postinstall] patch-ap-allow-private-address: snippet not found in ${filePath} — skipping`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,8 +90,12 @@ for (const filePath of candidates) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!source.includes(oldSnippet)) {
|
if (!source.includes(oldSnippet)) {
|
||||||
// Beta.41+ has native AI field cleanup — skip silently
|
// Already has AI field cleanup in some form — skip silently
|
||||||
if (source.includes('"ai-text-level"') && source.includes('"ai-code-level"')) {
|
if (
|
||||||
|
source.includes('"ai-text-level"') ||
|
||||||
|
source.includes('"aiTextLevel"') ||
|
||||||
|
!source.includes("jf2ToMf2")
|
||||||
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
console.warn(
|
console.warn(
|
||||||
|
|||||||
Reference in New Issue
Block a user