| 12 | const cliText = fs.readFileSync(cliMd, { encoding: 'utf8' }); |
| 13 | |
| 14 | const parseSection = (text, startMarker, endMarker) => { |
| 15 | const regExp = new RegExp(`${RegExp.escape(startMarker)}\r?\n([^]*)\r?\n${RegExp.escape(endMarker)}`); |
| 16 | const match = text.match(regExp); |
| 17 | if (!match) |
| 18 | assert.fail(`Unable to locate text between '${startMarker}' and '${endMarker}'.`); |
| 19 | return match[1] |
| 20 | .split(/\r?\n/) |
| 21 | .filter((val) => val.trim() !== ''); |
| 22 | }; |
| 23 | |
| 24 | const nodeOptionsLines = parseSection(cliText, |
| 25 | '<!-- node-options-node start -->', |