INNER CODE UNIT · JavaScript
matchTitle
rancher/terraform-provider-rancher2 · agent-scripts/after-ask.js:33
const matchTitle = planContent.match(/^#\s+(.+)$/m);
const title = matchTitle ? matchTitle[1].trim().replace(/[^a-zA-Z0-9-_]/g, '') : 'Plan';
activePlan = path.join(plansDir, `${title}.md`);
}
}
if (planContent && activePlan) {
try {
fs.writeFileSync(activePlan, planContent, { mode: 0o600 });
console.error(`🔒 Hook Info: Successfully bypassed write block to save plan to ${activePlan}`);
} catch (err) {
console.error(`🔒 Hook Error: Failed to write plan to ${activePlan}:`, err.message);
}
}
activePlan = activePlan || findLatestActivePlan(targetDir);
if (!activePlan) {
console.error('🔒 Cryptographic Pipeline Error: Active plan file not found.');