patchcord 0.5.40 → 0.5.41
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/bin/patchcord.mjs +7 -4
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -509,12 +509,15 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
509
509
|
copyFileSync(hookScriptSrc, hookScriptDest);
|
|
510
510
|
chmodSync(hookScriptDest, 0o755);
|
|
511
511
|
|
|
512
|
-
// Enable
|
|
513
|
-
|
|
512
|
+
// Enable hooks feature flag in config.toml if not already set
|
|
513
|
+
// Migrate any existing codex_hooks = true to hooks = true (deprecated)
|
|
514
|
+
if (globalCodexContent.includes("codex_hooks = true")) {
|
|
515
|
+
globalCodexContent = globalCodexContent.replace(/codex_hooks = true/g, "hooks = true");
|
|
516
|
+
} else if (!globalCodexContent.includes("hooks = true")) {
|
|
514
517
|
if (globalCodexContent.includes("[features]")) {
|
|
515
|
-
globalCodexContent = globalCodexContent.replace(/(\[features\])/, "$1\
|
|
518
|
+
globalCodexContent = globalCodexContent.replace(/(\[features\])/, "$1\nhooks = true");
|
|
516
519
|
} else {
|
|
517
|
-
globalCodexContent = globalCodexContent.trimEnd() + "\n\n[features]\
|
|
520
|
+
globalCodexContent = globalCodexContent.trimEnd() + "\n\n[features]\nhooks = true";
|
|
518
521
|
}
|
|
519
522
|
}
|
|
520
523
|
|