Closed msimerson closed 6 months ago
fs.readFileSync('docs/Plugins.md').toString()
.split('## Available Hooks')[1] // discard everything before this string
.split('### rcpt')[0] // discard everything after this string
.match(/\*\s(\S+)/gm) // grab the first word of lines starting with '* '
.map(a => a.replace(/^\* /, '').replace(/\\/g, '')) // strip off list prefix and escapes
child.spawnSync('awk', ['/## Available/,/## rcpt/{ if (/^\\*/) print $2 }', 'docs/Plugins.md'])
.stdout.toString()
.replace(/\\/g, '')
.split('\n')
This is clumsy because it doesn't always preserve hook firing order. See haraka/Haraka#3212
const hooks = Object.keys(plugins.registered_hooks);
Fixes #3272, Fixes #3212
Changes proposed in this pull request:
Checklist: