@groundtrack/hooks 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/doctor.js +2 -4
- package/package.json +1 -1
package/dist/doctor.js
CHANGED
|
@@ -267,14 +267,12 @@ function removeLegacyAgentInstructions(content) {
|
|
|
267
267
|
return lines.join("\n");
|
|
268
268
|
}
|
|
269
269
|
function upsertManagedContent(content, desired, migrateLegacyAgentInstructions = false) {
|
|
270
|
-
const existing =
|
|
271
|
-
? removeLegacyAgentInstructions(content ?? "")
|
|
272
|
-
: (content ?? "");
|
|
270
|
+
const existing = content ?? "";
|
|
273
271
|
const managed = /<!-- groundtrack:start version=\d+ -->[\s\S]*?<!-- groundtrack:end -->/;
|
|
274
272
|
if (managed.test(existing)) {
|
|
275
273
|
return `${existing.replace(managed, desired).trimEnd()}\n`;
|
|
276
274
|
}
|
|
277
|
-
const base = existing.trimEnd();
|
|
275
|
+
const base = (migrateLegacyAgentInstructions ? removeLegacyAgentInstructions(existing) : existing).trimEnd();
|
|
278
276
|
return `${base}${base ? "\n\n" : ""}${desired}\n`;
|
|
279
277
|
}
|
|
280
278
|
function versionParts(version) {
|